[vlc-commits] [Git][videolan/vlc][master] demux/mpeg: expose ID3v2 metadata via DEMUX_GET_META

François Cartegnie (@fcartegnie) gitlab at videolan.org
Wed Apr 22 09:32:23 UTC 2026



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
c571ff9c by Felix Paul Kühne at 2026-04-22T10:33:32+02:00
demux/mpeg: expose ID3v2 metadata via DEMUX_GET_META

This allows us to show the metadata without involving taglib and
therefore fixing the parsing for access modules where we reject the use
of taglib such as http.

Fixes #19209

- - - - -


1 changed file:

- modules/demux/mpeg/es.c


Changes:

=====================================
modules/demux/mpeg/es.c
=====================================
@@ -397,6 +397,8 @@ typedef struct
         sylt_track_t *p_track;
         bool b_meta_sent; /* true once sylt-data extra meta has been emitted */
     } sylt;
+
+    vlc_meta_t *p_meta;
 } demux_sys_t;
 
 static int MpgaProbe( demux_t *p_demux, uint64_t *pi_offset );
@@ -758,6 +760,8 @@ static void Close( vlc_object_t * p_this )
     TAB_CLEAN( p_sys->sylt.i_count, p_sys->sylt.p_track );
     if( p_sys->mllt.p_bits )
         free( p_sys->mllt.p_bits );
+    if( p_sys->p_meta )
+        vlc_meta_Delete( p_sys->p_meta );
     demux_PacketizerDestroy( p_sys->p_packetizer );
     free( p_sys );
 }
@@ -819,6 +823,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             *pb_bool = true;
             return VLC_SUCCESS;
 
+        case DEMUX_GET_META:
+            if( p_sys->p_meta == NULL )
+                return VLC_EGENERIC;
+            vlc_meta_Merge( va_arg( args, vlc_meta_t * ), p_sys->p_meta );
+            return VLC_SUCCESS;
+
         case DEMUX_GET_TIME:
             *va_arg( args, vlc_tick_t * ) = p_sys->i_pts + p_sys->i_time_offset;
             return VLC_SUCCESS;
@@ -1392,6 +1402,15 @@ static int ID3TAG_Parse_Handler( uint32_t i_tag, const uint8_t *p_payload, size_
     demux_t *p_demux = (demux_t *) p_priv;
     demux_sys_t *p_sys = p_demux->p_sys;
 
+    if( p_sys->p_meta == NULL )
+        p_sys->p_meta = vlc_meta_New();
+    if( p_sys->p_meta != NULL )
+    {
+        ID3HandleTag( p_payload, i_payload, i_tag, p_sys->p_meta, NULL );
+        if( i_tag == VLC_FOURCC('T', 'X', 'X', 'X') )
+            vlc_replay_gain_CopyFromMeta( &p_sys->audio_replay_gain, p_sys->p_meta );
+    }
+
     if( i_tag == VLC_FOURCC('M', 'L', 'L', 'T') )
     {
         if( i_payload > 20 )
@@ -1417,19 +1436,6 @@ static int ID3TAG_Parse_Handler( uint32_t i_tag, const uint8_t *p_payload, size_
         }
         return VLC_SUCCESS;
     }
-    else if( i_tag == VLC_FOURCC('T', 'X', 'X', 'X') )
-    {
-        vlc_meta_t *p_meta = vlc_meta_New();
-        if( p_meta )
-        {
-            bool b_updated;
-            if( ID3HandleTag( p_payload, i_payload, i_tag, p_meta, &b_updated ) )
-            {
-                vlc_replay_gain_CopyFromMeta( &p_sys->audio_replay_gain, p_meta );
-            }
-            vlc_meta_Delete( p_meta );
-        }
-    }
     else if ( i_tag == VLC_FOURCC('C', 'H', 'A', 'P') && i_payload >= 17 )
     {
         char *psz_title = strndup( (const char *)p_payload, i_payload - 16 );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c571ff9c1ea6c3c4642790cb3862a6b3fe61c549

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c571ff9c1ea6c3c4642790cb3862a6b3fe61c549
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list