[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: mp4: fix sidx lookup return timescale

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Mar 21 05:29:25 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
a151c9c4 by Francois Cartegnie at 2022-03-21T05:15:11+00:00
demux: mp4: fix sidx lookup return timescale

refs #26341

- - - - -
dfe420ab by Francois Cartegnie at 2022-03-21T05:15:11+00:00
demux: mp4: fix lack of tfdt fallback

refs #26341

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -1933,7 +1933,7 @@ static int FragSeekToTime( demux_t *p_demux, vlc_tick_t i_nztime, bool b_accurat
     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_qtime( i_sync_time, p_sys->i_timescale );
         msg_Dbg( p_demux, "seeking to sidx moof pos %" PRId64 " %" PRId64, i64, i_sync_time );
     }
     else
@@ -4865,12 +4865,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 != INVALID_SEGMENT_TIME )
-                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_qtime( p_sys->i_nztime, p_track->i_timescale );
+            {
+                if( i_moof_time != INVALID_SEGMENT_TIME )
+                    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_qtime( p_sys->i_nztime, p_track->i_timescale );
+            }
         }
 
         /* Parse TRUN data */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3ee0bb4c28fb8c9df32fb102e5a1176e81f6ab48...dfe420ab665b81b3f0da47e6614b5e6acf7a42e0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3ee0bb4c28fb8c9df32fb102e5a1176e81f6ab48...dfe420ab665b81b3f0da47e6614b5e6acf7a42e0
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