diff options
author | Marco Nelissen <marcone@google.com> | 2012-03-16 07:56:42 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2012-03-16 08:36:30 -0700 |
commit | 9e50385f34676d8fcb3b473ec4c9f5c388a4c887 (patch) | |
tree | c8a2f02e79d48b8505b40eb8df6784583af75e09 /media/libstagefright/MP3Extractor.cpp | |
parent | 5102400104ce1f0a6de7bf913381a91e4f18a22a (diff) | |
download | frameworks_av-9e50385f34676d8fcb3b473ec4c9f5c388a4c887.zip frameworks_av-9e50385f34676d8fcb3b473ec4c9f5c388a4c887.tar.gz frameworks_av-9e50385f34676d8fcb3b473ec4c9f5c388a4c887.tar.bz2 |
Skip XING/VBRI frame when decoding
Don't send the XING/VBRI frame to the decoder, as it will result in
extra data being output. Also clean up the XING seeker code a bit.
Change-Id: I714a94180edae9bedc1bc0c96bf382fe6f928ac6
Diffstat (limited to 'media/libstagefright/MP3Extractor.cpp')
-rw-r--r-- | media/libstagefright/MP3Extractor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/MP3Extractor.cpp b/media/libstagefright/MP3Extractor.cpp index 2215c07..69209b5 100644 --- a/media/libstagefright/MP3Extractor.cpp +++ b/media/libstagefright/MP3Extractor.cpp @@ -317,6 +317,13 @@ MP3Extractor::MP3Extractor( mSeeker = VBRISeeker::CreateFromSource(mDataSource, post_id3_pos); } + if (mSeeker != NULL) { + // While it is safe to send the XING/VBRI frame to the decoder, this will + // result in an extra 1152 samples being output. The real first frame to + // decode is after the XING/VBRI frame, so skip there. + mFirstFramePos += frame_size; + } + int64_t durationUs; if (mSeeker == NULL || !mSeeker->getDuration(&durationUs)) { |