[vlc-commits] [Git][videolan/vlc][3.0.x] 3 commits: demux: mp4: fix inverted logic

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Jan 2 17:07:28 UTC 2022



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
a004ccdb by Zhao Zhili at 2021-12-30T13:01:05+08:00
demux: mp4: fix inverted logic

(cherry picked from commit b79dabdd05cb9e575d4c8b44607833ef803f37ac)

- - - - -
a308e178 by Zhao Zhili at 2021-12-30T13:02:00+08: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.

- - - - -
b014a482 by Zhao Zhili at 2021-12-30T13:02:11+08: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
=====================================
@@ -4313,9 +4313,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;
 
@@ -4433,7 +4430,7 @@ static int DemuxMoof( demux_t *p_demux )
             mp4_track_t *tk_tmp = &p_sys->track[i];
 
             if( !tk_tmp->b_ok || tk_tmp->b_chapters_source ||
-               (!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;
@@ -4458,8 +4455,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 || tk_tmp->b_chapters_source ||
-                   (!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;
 
                 mtime_t i_nzdts = MP4_rescale( tk_tmp->i_time, tk_tmp->i_timescale, CLOCK_FREQ );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/870c1376343bf25edef9376e059c4343b1a55bc5...b014a4825d0ebcfd4fe43b3f6f0bc47d14847d53

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




More information about the vlc-commits mailing list