[vlc-commits] [Git][videolan/vlc][3.0.x] demux: mp4: fix missing traf start

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun May 18 10:38:46 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
e4cf8cce by François Cartegnie at 2025-05-18T10:14:59+00:00
demux: mp4: fix missing traf start

(cherry picked from commit 3fae8409a472c5df3e31b4e9a5ecfcc47d9edb21)

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -4296,29 +4296,25 @@ static int ProbeFragments( demux_t *p_demux, bool b_force, bool *pb_fragmented )
 
                 for( unsigned i=0; i<p_sys->i_tracks; i++ )
                 {
-                    stime_t i_duration = 0;
                     MP4_Box_t *p_tfdt = NULL;
                     MP4_Box_t *p_traf = MP4_GetTrafByTrackID( p_moof, p_sys->track[i].i_track_ID );
                     if( p_traf )
                         p_tfdt = MP4_BoxGet( p_traf, "tfdt" );
 
-                    /* Set first fragment time offset from moov */
-                    if( index == 0 )
-                        pi_track_times[i] = GetMoovTrackDuration( p_sys, p_sys->track[i].i_track_ID );
-
                     if( p_tfdt && BOXDATA(p_tfdt) )
                     {
                         pi_track_times[i] = p_tfdt->data.p_tfdt->i_base_media_decode_time;
                     }
                     else if( index == 0 ) /* Set first fragment time offset from moov */
                     {
-                        i_duration = GetMoovTrackDuration( p_sys, p_sys->track[i].i_track_ID );
+                        stime_t i_duration = GetMoovTrackDuration( p_sys, p_sys->track[i].i_track_ID );
                         pi_track_times[i] = MP4_rescale( i_duration, p_sys->i_timescale, p_sys->track[i].i_timescale );
                     }
 
                     stime_t i_movietime = MP4_rescale( pi_track_times[i], p_sys->track[i].i_timescale, p_sys->i_timescale );
                     p_sys->p_fragsindex->p_times[index * p_sys->i_tracks + i] = i_movietime;
 
+                    stime_t i_duration = 0;
                     if( GetMoofTrackDuration( p_sys->p_moov, p_moof, p_sys->track[i].i_track_ID, &i_duration ) )
                         pi_track_times[i] += i_duration;
                 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e4cf8ccefe49d9a2a4717409e18997f556b84e21

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e4cf8ccefe49d9a2a4717409e18997f556b84e21
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