diff options
author | Marco Nelissen <marcone@google.com> | 2012-06-13 08:51:00 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2012-06-13 16:29:52 -0700 |
commit | 5fd7d3a23316ec0d2320fece85201859b52c2aef (patch) | |
tree | eb812fe337a080a3f3709e2fbbd992813bc5583c /media/libstagefright/VBRISeeker.cpp | |
parent | b4ea1ab821d652cb080910d4081f5f1318597a90 (diff) | |
download | frameworks_av-5fd7d3a23316ec0d2320fece85201859b52c2aef.zip frameworks_av-5fd7d3a23316ec0d2320fece85201859b52c2aef.tar.gz frameworks_av-5fd7d3a23316ec0d2320fece85201859b52c2aef.tar.bz2 |
Better handle invalid duration in Xing/VBRI tags
b/6654637
Change-Id: Ie92eddd84ef5914b77dbadaacd80b4de6cd66e1c
Diffstat (limited to 'media/libstagefright/VBRISeeker.cpp')
-rw-r--r-- | media/libstagefright/VBRISeeker.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/media/libstagefright/VBRISeeker.cpp b/media/libstagefright/VBRISeeker.cpp index bcba874..a245f2c 100644 --- a/media/libstagefright/VBRISeeker.cpp +++ b/media/libstagefright/VBRISeeker.cpp @@ -93,7 +93,13 @@ sp<VBRISeeker> VBRISeeker::CreateFromSource( sp<VBRISeeker> seeker = new VBRISeeker; seeker->mBasePos = post_id3_pos + frameSize; - seeker->mDurationUs = durationUs; + // only update mDurationUs if the calculated duration is valid (non zero) + // otherwise, leave duration at -1 so that getDuration() and getOffsetForTime() + // return false when called, to indicate that this vbri tag does not have the + // requested information + if (durationUs) { + seeker->mDurationUs = durationUs; + } off64_t offset = post_id3_pos; for (size_t i = 0; i < numEntries; ++i) { |