[vlc-commits] [Git][videolan/vlc][master] 3 commits: demux: mp4: fix inverted logic

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Dec 27 17:41:45 UTC 2021



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


Commits:
b79dabdd by Zhao Zhili at 2021-12-27T17:21:22+00:00
demux: mp4: fix inverted logic

- - - - -
c6fe9cbc by Zhao Zhili at 2021-12-27T17:21:22+00:00
demux: mp4: fix dead loop

The first pass select track A, then the second pass select track B,
FragDemuxTrack(B) return EOF, the loop continue forever.

- - - - -
cecf0a6b by Zhao Zhili at 2021-12-27T17:21:22+00:00
demux: mp4: continue to next trun instead of return eof

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -4547,9 +4547,6 @@ static int FragDemuxTrack( demux_t *p_demux, mp4_track_t *p_track,
     const MP4_Box_data_trun_t *p_trun =
             p_track->context.runs.p_array[p_track->context.runs.i_current].p_trun->data.p_trun;
 
-    if( p_track->context.i_trun_sample >= p_trun->i_sample_count )
-        return VLC_DEMUXER_EOS;
-
     uint32_t dur = p_track->context.i_default_sample_duration,
              len = p_track->context.i_default_sample_size;
 
@@ -4667,7 +4664,7 @@ static int DemuxMoof( demux_t *p_demux )
             mp4_track_t *tk_tmp = &p_sys->track[i];
 
             if( !tk_tmp->b_ok || MP4_isMetadata( tk_tmp ) ||
-               (!tk_tmp->b_selected && !p_sys->b_seekable) ||
+               (!tk_tmp->b_selected && p_sys->b_seekable) ||
                 tk_tmp->context.runs.i_current >= tk_tmp->context.runs.i_count ||
                 tk_tmp->context.i_temp != VLC_DEMUXER_SUCCESS )
                 continue;
@@ -4692,8 +4689,9 @@ static int DemuxMoof( demux_t *p_demux )
                 mp4_track_t *tk_tmp = &p_sys->track[i];
                 if( tk_tmp == tk ||
                     !tk_tmp->b_ok || MP4_isMetadata( tk_tmp ) ||
-                   (!tk_tmp->b_selected && !p_sys->b_seekable) ||
-                    tk_tmp->context.runs.i_current >= tk_tmp->context.runs.i_count )
+                   (!tk_tmp->b_selected && p_sys->b_seekable) ||
+                    tk_tmp->context.runs.i_current >= tk_tmp->context.runs.i_count ||
+                    tk_tmp->context.i_temp != VLC_DEMUXER_SUCCESS )
                     continue;
 
                 vlc_tick_t i_nzdts = MP4_rescale_mtime( tk_tmp->i_time, tk_tmp->i_timescale );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/543675fa43a508380bc8696970ac66328eaaeab2...cecf0a6b2a88bbfe694bfc5608a600cc8ff3b724

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




More information about the vlc-commits mailing list