File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -275,8 +275,9 @@ impl Default for Mp4parseTrackVideoInfo {
275
275
#[ derive( Default , Debug ) ]
276
276
pub struct Mp4parseFragmentInfo {
277
277
pub fragment_duration : u64 , // in ticks
278
- // TODO:
279
- // info in trex box.
278
+ pub time_scale : u64 ,
279
+ // TODO:
280
+ // info in trex box.
280
281
}
281
282
282
283
#[ derive( Default ) ]
@@ -1425,14 +1426,12 @@ pub unsafe extern "C" fn mp4parse_get_fragment_info(
1425
1426
None => return Mp4parseStatus :: Invalid ,
1426
1427
} ;
1427
1428
1428
- match duration {
1429
- Some ( duration_ticks) => {
1430
- info. fragment_duration = duration_ticks. 0 ;
1431
- }
1432
- None => return Mp4parseStatus :: Invalid ,
1429
+ if let ( Some ( time) , Some ( scale) ) = ( duration, context. timescale ) {
1430
+ info. fragment_duration = time. 0 ;
1431
+ info. time_scale = scale. 0 ;
1432
+ return Mp4parseStatus :: Ok ;
1433
1433
} ;
1434
-
1435
- Mp4parseStatus :: Ok
1434
+ Mp4parseStatus :: Invalid
1436
1435
}
1437
1436
1438
1437
/// Determine if an mp4 file is fragmented. A fragmented file needs mvex table
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ fn parse_fragment() {
59
59
rv = mp4parse_get_fragment_info ( parser, & mut fragment_info) ;
60
60
assert_eq ! ( rv, Mp4parseStatus :: Ok ) ;
61
61
assert_eq ! ( fragment_info. fragment_duration, 10_032 ) ;
62
+ assert_eq ! ( fragment_info. time_scale, 1000 ) ;
62
63
63
64
mp4parse_free ( parser) ;
64
65
}
You can’t perform that action at this time.
0 commit comments