[vlc-commits] demux: mp4: fix missing traf start

Francois Cartegnie git at videolan.org
Mon Apr 30 17:32:17 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Apr 27 16:00:09 2018 +0200| [3fae8409a472c5df3e31b4e9a5ecfcc47d9edb21] | committer: Francois Cartegnie

demux: mp4: fix missing traf start

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3fae8409a472c5df3e31b4e9a5ecfcc47d9edb21
---

 modules/demux/mp4/mp4.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 28e42ff708..b03d48354b 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -4263,29 +4263,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;
                 }



More information about the vlc-commits mailing list