OSDN Git Service

Bug fix for the MediaPlayer::prepare() api.
authorDylan Powers <dylan.kyle.powers@gmail.com>
Wed, 28 Nov 2012 00:06:38 +0000 (16:06 -0800)
committerMarco Nelissen <marcone@google.com>
Thu, 29 Nov 2012 23:02:00 +0000 (15:02 -0800)
commit47c1a5f7c13d82aa8834fd4543bd1d713b97808e
tree9e9cfea022e716371a5e8d03d4b00a2f579d5d43
parent5dea84c39b5e790315b525009c635806e33c97e0
Bug fix for the MediaPlayer::prepare() api.

For an MP3 source, within the prepare command, ID3 tags are checked in search of
gapless playback info. This causes problems for streamed sources. If ID3v2 tags
aren't present, then a check is done for ID3v1 tags. This results in a read
command that asks the cache to jump to the end of the file, and subsequently
make an extra http call to request those bytes. For a streamed source, this
causes the file to not be downloaded automatically when MediaPlayer::prepare()
is called, and causes stuttering and extra buffering time to be needed when
start() is finally called.
The solution is to ignore the ID3v1 tags as the gapless info would never exist
there, and only check for ID3v2 tags.

Cherrypicked from external contribution ffd6ffc5429c45577fd8e9f8fa90e79bb91b8a84
b/7638165

Change-Id: I7d1b94cffbfe7c38ca094834dedbc92a58855e20
media/libstagefright/MP3Extractor.cpp
media/libstagefright/id3/ID3.cpp
media/libstagefright/include/ID3.h