summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-03-11 11:02:17 -0800
committerJames Dong <jdong@google.com>2011-03-11 11:02:17 -0800
commit9dec4911624b449afcf42a8d99ac78ca73952331 (patch)
treedc0d7912704c0cdd126bfb83f238560f4c827574 /media/libstagefright/codecs
parent0ef631528fa7a2f061aea2bdd68ef734ed626b87 (diff)
downloadframeworks_av-9dec4911624b449afcf42a8d99ac78ca73952331.zip
frameworks_av-9dec4911624b449afcf42a8d99ac78ca73952331.tar.gz
frameworks_av-9dec4911624b449afcf42a8d99ac78ca73952331.tar.bz2
MP3Extractor and MP3 decoder fixes - DO NOT MERGE
cherry-picked the following patches from HC branch: o PV's mp3 decoder mistreated inputBufferCurrentLength in unit of bytes as in unit of bits o Do not enforce the rule in MP3Extractor that all audio frames in an mp3 file must have the same mode o When the temp buffer wraps around, the next read position should start from what have been read to avoid reading the same remaining bytes in the buffer again. o Speed up MP3Extractor using cached reads bug - 4083532 Change-Id: I7bbd2bd358fd5ee322287866cb8ee0c2bb217fea
Diffstat (limited to 'media/libstagefright/codecs')
-rw-r--r--media/libstagefright/codecs/mp3dec/src/pvmp3_decode_header.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libstagefright/codecs/mp3dec/src/pvmp3_decode_header.cpp b/media/libstagefright/codecs/mp3dec/src/pvmp3_decode_header.cpp
index 8b0250a..d443b7c 100644
--- a/media/libstagefright/codecs/mp3dec/src/pvmp3_decode_header.cpp
+++ b/media/libstagefright/codecs/mp3dec/src/pvmp3_decode_header.cpp
@@ -121,9 +121,11 @@ ERROR_CODE pvmp3_decode_header(tmp3Bits *inputStream,
uint32 temp;
/*
- * Verify that at least the header is complete
+ * Verify that at least the header is complete
+ * Note that SYNC_WORD_LNGTH is in unit of bits, but inputBufferCurrentLength
+ * is in unit of bytes.
*/
- if (inputStream->inputBufferCurrentLength < (SYNC_WORD_LNGTH + 21))
+ if (inputStream->inputBufferCurrentLength < ((SYNC_WORD_LNGTH + 21) >> 3))
{
return NO_ENOUGH_MAIN_DATA_ERROR;
}