Bug 1142433: Properly scale duration found in movie extend header box. r=k17e
☠☠ backed out by aa48e92f7e57 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 13 Mar 2015 09:42:28 +1100
changeset 263754 1ee5457afe8c943473dac36202ff31514bc44df0
parent 263753 6ef6ea1d4437d7114b1f0e581ab752d277eac603
child 263755 4b936da89beb3c7bd32117f4d53d9575c22c781d
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersk17e
bugs1142433
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1142433: Properly scale duration found in movie extend header box. r=k17e
media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp
--- a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp
@@ -1784,18 +1784,19 @@ status_t MPEG4Extractor::parseChunk(off6
                 uint32_t duration32;
                 if (mDataSource->readAt(
                             data_offset + 4, &duration32, sizeof(duration32))
                         < (ssize_t)sizeof(duration32)) {
                     return ERROR_IO;
                 }
                 duration = ntohl(duration32);
             }
-            if (duration) {
-              mFileMetaData->setInt64(kKeyMovieDuration, duration * 1000LL);
+            if (duration && mHeaderTimescale) {
+                mFileMetaData->setInt64(
+                        kKeyMovieDuration, (duration * 1000000) / mHeaderTimescale);
             }
 
             *offset += chunk_size;
             break;
         }
 
         case FOURCC('m', 'd', 'a', 't'):
         {