diff options
author | Marco Nelissen <marcone@google.com> | 2013-11-26 02:10:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-11-26 02:10:18 +0000 |
commit | 90892d1be84776f59a619ea4ef9ce51be5828ff8 (patch) | |
tree | 5c66eaa8374e5153ff7c8a5677d44a2a821002e1 | |
parent | 11e715589e0f3f96389d0eedab677369da680fd4 (diff) | |
parent | 465127fa3dfba81d8ad2a164ba6036478f71c8a6 (diff) | |
download | frameworks_av-90892d1be84776f59a619ea4ef9ce51be5828ff8.zip frameworks_av-90892d1be84776f59a619ea4ef9ce51be5828ff8.tar.gz frameworks_av-90892d1be84776f59a619ea4ef9ce51be5828ff8.tar.bz2 |
Merge "Fix SIGABRT when playing mp4 file"
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index d0b6185..13e22d6 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -963,6 +963,12 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { mLastTrack->meta->setInt32(kKeyEncoderDelay, delay); int64_t paddingus = duration - (segment_duration + media_time); + if (paddingus < 0) { + // track duration from media header (which is what kKeyDuration is) might + // be slightly shorter than the segment duration, which would make the + // padding negative. Clamp to zero. + paddingus = 0; + } int64_t paddingsamples = (paddingus * samplerate + 500000) / 1000000; mLastTrack->meta->setInt32(kKeyEncoderPadding, paddingsamples); } |