diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 20:34:46 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 20:34:46 +0000 |
commit | d5e3134ae95c77ba72383c4299d47140b5c57468 (patch) | |
tree | ec439794cea7f374c44aafcb9de095d3ba5d9319 /media/base | |
parent | 55f773b1a8a98dd59d73071f7294e928712d64a7 (diff) | |
download | chromium_src-d5e3134ae95c77ba72383c4299d47140b5c57468.zip chromium_src-d5e3134ae95c77ba72383c4299d47140b5c57468.tar.gz chromium_src-d5e3134ae95c77ba72383c4299d47140b5c57468.tar.bz2 |
Temporary fix for MP3 decoding by duplicating packets before handing them to the decoder.
Turns out packets filled out by av_read_frame() were being modifying on subsequent calls to av_read_frame(). Might be a case of setting the data pointer to internal memory as opposed to allocated memory.
Review URL: http://codereview.chromium.org/115561
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/media_posix.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc index 94c1a89..57e1b77 100644 --- a/media/base/media_posix.cc +++ b/media/base/media_posix.cc @@ -27,6 +27,11 @@ int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) { return av_get_bits_per_sample_format_ptr(sample_fmt); } +int (*av_new_packet_ptr)(AVPacket* pkt, int size); +int av_new_packet(AVPacket* pkt, int size) { + return av_new_packet_ptr(pkt, size); +} + void (*avcodec_init_ptr)(void) = NULL; void avcodec_init(void) { avcodec_init_ptr(); @@ -194,6 +199,9 @@ bool InitializeMediaLibrary(const FilePath& module_dir) { av_get_bits_per_sample_format_ptr = reinterpret_cast<int (*)(enum SampleFormat)>( dlsym(libs[FILE_LIBAVCODEC], "av_get_bits_per_sample_format")); + av_new_packet_ptr = + reinterpret_cast<int (*)(AVPacket*, int)>( + dlsym(libs[FILE_LIBAVCODEC], "av_new_packet")); avcodec_init_ptr = reinterpret_cast<void(*)(void)>( dlsym(libs[FILE_LIBAVCODEC], "avcodec_init")); @@ -251,6 +259,7 @@ bool InitializeMediaLibrary(const FilePath& module_dir) { // Check that all the symbols were loaded correctly before returning true. if (av_get_bits_per_sample_format_ptr && + av_new_packet_ptr && avcodec_init_ptr && avcodec_find_decoder_ptr && avcodec_thread_init_ptr && |