[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: mp4: base chapters + ES logic on brand instead of codec

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Apr 28 11:21:31 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ca6551dd by Francois Cartegnie at 2023-04-28T09:07:52+00:00
demux: mp4: base chapters + ES logic on brand instead of codec

Chapters are no longer loading on 4.0 as the codec is no longer
merged as TX3G. This fix no longer relies on the codec and allows
to avoid enabling chapters as SPU_ES as ffmpeg muxes chapters the
Quicktime way without using that brand.

refs #25561

- - - - -
d4841a3d by Francois Cartegnie at 2023-04-28T09:07:52+00:00
demux: mp4: tag Apple chapters as non defaultable SPU

- - - - -


1 changed file:

- modules/demux/mp4/mp4.c


Changes:

=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -115,6 +115,7 @@ typedef struct
     mp4_track_t  *track;         /* array of track */
     float        f_fps;          /* number of frame per seconds */
 
+    bool         b_quicktime;
     bool         b_fragmented;   /* fMP4 */
     bool         b_seekable;
     bool         b_fastseekable;
@@ -1035,6 +1036,7 @@ static int Open( vlc_object_t * p_this )
                 break;
             case BRAND_qt__:
                 msg_Dbg( p_demux, "Apple QuickTime media" );
+                p_sys->b_quicktime = true;
                 break;
             case BRAND_isml:
                 msg_Dbg( p_demux, "PIFF (= isml = fMP4) media" );
@@ -2541,8 +2543,7 @@ static void LoadChapter( demux_t  *p_demux )
         for( unsigned i = 0; i < p_sys->i_tracks; i++ )
         {
             mp4_track_t *tk = &p_sys->track[i];
-            if(tk->b_ok && (tk->i_use_flags & USEAS_CHAPTERS) &&
-               tk->fmt.i_cat == SPU_ES && tk->fmt.i_codec == VLC_CODEC_TX3G)
+            if ( tk->b_ok && (tk->i_use_flags & USEAS_CHAPTERS) && tk->fmt.i_cat == SPU_ES )
             {
                 LoadChapterApple( p_demux, tk );
                 break;
@@ -3785,8 +3786,7 @@ static void MP4_TrackSetup( demux_t *p_demux, mp4_track_t *p_track,
     p_track->i_sample = 0;
 
     /* Disable chapter only track */
-    if( p_track->fmt.i_cat == UNKNOWN_ES &&
-       (p_track->i_use_flags & USEAS_CHAPTERS) )
+    if( (p_track->i_use_flags & USEAS_CHAPTERS) && !p_sys->b_quicktime )
         p_track->b_enable = false;
 
     const MP4_Box_t *p_tsel;
@@ -3845,7 +3845,7 @@ static void MP4_TrackSetup( demux_t *p_demux, mp4_track_t *p_track,
         p_track->fmt.i_priority = ES_PRIORITY_NOT_DEFAULTABLE;
     }
 
-    if( !p_track->b_enable )
+    if( !p_track->b_enable || (p_track->i_use_flags & USEAS_CHAPTERS) )
         p_track->fmt.i_priority = ES_PRIORITY_NOT_DEFAULTABLE;
 
     if( TrackCreateES( p_demux,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e6ff7c6e59fde04b40d0e33cd3198a2a036b7348...d4841a3d06de08071cb68fe40138a476238c7571

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