OSDN Git Service

Fix iTunSMPB parsing for AAC tracks encoded with Nero
authorJohn Grossman <johngro@google.com>
Fri, 7 Sep 2012 18:41:07 +0000 (11:41 -0700)
committerJohn Grossman <johngro@google.com>
Fri, 7 Sep 2012 20:39:12 +0000 (13:39 -0700)
commit8c7d147cca17961a71209c105a2676a552d3d69f
treee874f15abe6e51d1e550717520e2141aad29d490
parent5a4f93eaaab7518fd734fdc9f0f686d632f31a59
Fix iTunSMPB parsing for AAC tracks encoded with Nero

Make sure to clear out the mean/name/data state when parsing
apple-style metadata from tracks every time we have a full set, not
just when we find an iTunSMPB set.

AAC tracks encoded from WAV by Nero tend to put in an additional apple
style metadata tag (cdec) before the iTunSMPB tag.  The sequence in
the file goes something like

mean : "com.apple.iTunes"
name : "cdec"
data : "ndaudio 1.5.4.0 / -2pass -br 320000"
mean : "com.apple.iTunes"
name : "iTunSMPB"
data : " 00000000 00000A40 000000B8 <etc...>"

If the internal state was not cleared after the first set, then when
the second instance of "name" is encountered, an attempt is made to
parse the previous data entry as an iTunSMPB tag when it is actually a
cdec tag.  Afterwards, mean, name and data are all cleared, and when
the second data is encountered there is no current mean or name
present, so the gapless metadata gets skipped.  By clearing the
metadata state every time we have a full set of mean/name/data, we
make sure that we are always interpreting the data field as the proper
type.

Change-Id: I196e2e3f83e434f15d5ee55ae40a74a92d5a1845
media/libstagefright/MPEG4Extractor.cpp