[vlc-commits] [Git][videolan/vlc][3.0.x] 3 commits: demux: mp4: fix unaligned trun seek

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Fri Mar 25 15:02:22 UTC 2022



Hugo Beauzée-Luyssen pushed to branch 3.0.x at VideoLAN / VLC


Commits:
7d54e53d by Francois Cartegnie at 2022-03-25T14:30:09+00:00
demux: mp4: fix unaligned trun seek

refs #26719

(cherry picked from commit 3ee0bb4c28fb8c9df32fb102e5a1176e81f6ab48)

- - - - -
ebc5dfde by Francois Cartegnie at 2022-03-25T14:30:09+00:00
demux: mp4: fix sidx lookup return timescale

refs #26341

(cherry picked from commit a151c9c40f3487764fc28acc32ff6657fb782329)

- - - - -
3f3dce1e by Francois Cartegnie at 2022-03-25T14:30:09+00:00
demux: mp4: fix lack of tfdt fallback

refs #26341

(cherry picked from commit dfe420ab665b81b3f0da47e6614b5e6acf7a42e0)

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -1652,6 +1652,7 @@ static void FragTrunSeekToTime( mp4_track_t *p_track, stime_t i_target_time )
     p_track->context.i_trun_sample = i_sample;
     p_track->context.i_trun_sample_pos = i_pos;
     p_track->context.runs.i_current = i_run;
+    p_track->i_time = i_time;
 }
 
 static int FragSeekToTime( demux_t *p_demux, mtime_t i_nztime, bool b_accurate )
@@ -1686,7 +1687,7 @@ static int FragSeekToTime( demux_t *p_demux, mtime_t i_nztime, bool b_accurate )
     else if( FragGetMoofBySidxIndex( p_demux, i_nztime, &i64, &i_sync_time ) == VLC_SUCCESS )
     {
         /* provides base offset */
-        i_segment_time = i_sync_time;
+        i_segment_time = MP4_rescale( i_sync_time, CLOCK_FREQ, p_sys->i_timescale );
         msg_Dbg( p_demux, "seeking to sidx moof pos %" PRId64 " %" PRId64, i64, i_sync_time );
     }
     else
@@ -4623,12 +4624,13 @@ static int FragCreateTrunIndex( demux_t *p_demux, MP4_Box_t *p_moof,
             }
 
             /* Use global sidx moof time, in case moof does not carry tfdt */
-            if( !b_has_base_media_decode_time && i_moof_time != INT64_MAX )
-                i_traf_start_time = MP4_rescale( i_moof_time, p_sys->i_timescale, p_track->i_timescale );
-
-            /* That should not happen */
             if( !b_has_base_media_decode_time )
-                i_traf_start_time = MP4_rescale( p_sys->i_nztime, CLOCK_FREQ, p_track->i_timescale );
+            {
+                if( i_moof_time != INT64_MAX )
+                    i_traf_start_time = MP4_rescale( i_moof_time, p_sys->i_timescale, p_track->i_timescale );
+                else /* That should not happen */
+                    i_traf_start_time = MP4_rescale( p_sys->i_nztime, CLOCK_FREQ, p_track->i_timescale );
+            }
         }
 
         /* Parse TRUN data */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d6ffeba288c533f0531541fe8a97d8bda60fd25c...3f3dce1e93e3248b793501d3ac9bc52ade7dd64e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d6ffeba288c533f0531541fe8a97d8bda60fd25c...3f3dce1e93e3248b793501d3ac9bc52ade7dd64e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list