Bug 1229615 - Don't reject files without edit lists. r=kinetik
authorRalph Giles <giles@mozilla.com>
Tue, 01 Dec 2015 17:45:29 -0800
changeset 309498 3af84d7471c84aa7f29cac7dab591f7de4ff103b
parent 309497 2d2e1828198272efcc76d0a62b54cfd146143534
child 309499 d036b1daeb0b1b61f85f69eff722eeccccd5ffd4
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1229615
milestone45.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 1229615 - Don't reject files without edit lists. r=kinetik Patch from upstream.
media/libstagefright/binding/capi.rs
--- a/media/libstagefright/binding/capi.rs
+++ b/media/libstagefright/binding/capi.rs
@@ -128,25 +128,31 @@ pub unsafe extern "C" fn mp4parse_get_tr
         TrackType::Video => TRACK_TYPE_H264,
         TrackType::Audio => TRACK_TYPE_AAC,
         TrackType::Unknown => return -1,
     };
 
     // Maybe context & track should just have a single simple is_valid() instead?
     if context.timescale.is_none() ||
         track.timescale.is_none() ||
-        track.empty_duration.is_none() ||
-        track.media_time.is_none() ||
         track.duration.is_none() ||
         track.track_id.is_none() {
             return -1;
         }
 
-    let empty_duration = media_time_to_ms(track.empty_duration.unwrap(), context.timescale.unwrap());
-    (*info).media_time = track_time_to_ms(track.media_time.unwrap(), track.timescale.unwrap()) as i64 - empty_duration as i64;
+    let empty_duration = if track.empty_duration.is_some() {
+        media_time_to_ms(track.empty_duration.unwrap(), context.timescale.unwrap())
+    } else {
+        0
+    };
+    (*info).media_time = if track.media_time.is_some() {
+        track_time_to_ms(track.media_time.unwrap(), track.timescale.unwrap()) as i64 - empty_duration as i64
+    } else {
+        0
+    };
     (*info).duration = track_time_to_ms(track.duration.unwrap(), track.timescale.unwrap());
     (*info).track_id = track.track_id.unwrap();
 
     0
 }
 
 #[no_mangle]
 pub unsafe extern "C" fn mp4parse_get_track_audio_info(context: *mut MediaContext, track: i32, info: *mut TrackAudioInfo) -> i32 {