From 707963369222072adc602f327aaf0565bc1393b7 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Wed, 18 Mar 2015 14:10:57 +1100 Subject: [PATCH] Bug 1142433: Properly scale duration found in movie extend header box. r=k17e --- .../frameworks/av/media/libstagefright/MPEG4Extractor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp index 013be0cc265..3a80ecfc2e0 100644 --- a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp @@ -1789,8 +1789,9 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) { } duration = ntohl(duration32); } - if (duration) { - mFileMetaData->setInt64(kKeyMovieDuration, duration * 1000LL); + if (duration && mHeaderTimescale) { + mFileMetaData->setInt64( + kKeyMovieDuration, (duration * 1000000) / mHeaderTimescale); } *offset += chunk_size;