[vlc-commits] [Git][videolan/vlc][master] 3 commits: demux: mp4: check number of spu samples for chapters

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri May 5 10:36:41 UTC 2023



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


Commits:
e0a16905 by Francois Cartegnie at 2023-05-05T10:07:57+00:00
demux: mp4: check number of spu samples for chapters

- - - - -
e525ab20 by Francois Cartegnie at 2023-05-05T10:07:57+00:00
demux: mp4: increment chunk with sample reading apple chapters

- - - - -
3b792ad4 by Francois Cartegnie at 2023-05-05T10:07:57+00:00
demux: mp4: fix timestamp regression reading chapters

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -183,6 +183,7 @@ static uint64_t MP4_TrackGetPos    ( mp4_track_t * );
 static uint32_t MP4_TrackGetReadSize( mp4_track_t *, uint32_t * );
 static int      MP4_TrackNextSample( demux_t *, mp4_track_t *, uint32_t );
 static void     MP4_TrackSetELST( demux_t *, mp4_track_t *, vlc_tick_t );
+static void TrackUpdateSampleAndTimes( mp4_track_t *p_track );
 
 static void     MP4_UpdateSeekpoint( demux_t *, vlc_tick_t );
 
@@ -2480,11 +2481,19 @@ static void LoadChapterApple( demux_t  *p_demux, mp4_track_t *tk )
 
     for( tk->i_sample = 0; tk->i_sample < tk->i_sample_count; tk->i_sample++ )
     {
+        if( tk->i_sample >= tk->chunk[tk->i_chunk].i_sample_first +
+                            tk->chunk[tk->i_chunk].i_sample_count )
+            tk->i_chunk++;
+        TrackUpdateSampleAndTimes( tk );
+
         vlc_tick_t i_pts;
         MP4_TrackGetDTSPTS( p_demux, tk, &i_pts );
         uint32_t i_nb_samples = 0;
         const uint32_t i_size = MP4_TrackGetReadSize( tk, &i_nb_samples );
 
+        if( i_nb_samples > 1 )
+            break; /* should not happen */
+
         if( i_size > 0 && !vlc_stream_Seek( p_demux->s, MP4_TrackGetPos( tk ) ) )
         {
             char p_buffer[256];
@@ -2517,9 +2526,6 @@ static void LoadChapterApple( demux_t  *p_demux, mp4_track_t *tk )
                 TAB_APPEND( p_sys->p_title->i_seekpoint, p_sys->p_title->seekpoint, s );
             }
         }
-        if( tk->i_sample+1 >= tk->chunk[tk->i_chunk].i_sample_first +
-                              tk->chunk[tk->i_chunk].i_sample_count )
-            tk->i_chunk++;
     }
 }
 static void LoadChapter( demux_t  *p_demux )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f9b7d8aa886d726d82f43a6760344762d0dbdb02...3b792ad476fc2ce32264a8a1b9a2e2c95da9aa73

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