[vlc-commits] [Git][videolan/vlc][master] 6 commits: meta: add a compilation flag

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Aug 6 07:41:00 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
03a902c4 by Felix Paul Kühne at 2026-08-06T09:28:57+02:00
meta: add a compilation flag

- - - - -
80251c56 by Felix Paul Kühne at 2026-08-06T09:28:57+02:00
libvlc: expose the compilation meta

- - - - -
f246517c by Felix Paul Kühne at 2026-08-06T09:28:57+02:00
mp4: read the iTunes cpil compilation flag

- - - - -
9e7445c9 by Felix Paul Kühne at 2026-08-06T09:28:57+02:00
ID3: read the TCMP compilation frame

- - - - -
3932739a by Felix Paul Kühne at 2026-08-06T09:28:57+02:00
asf: read the WM/IsCompilation descriptor

- - - - -
fd0afd49 by Felix Paul Kühne at 2026-08-06T09:28:57+02:00
taglib: read the compilation flag

- - - - -


15 changed files:

- include/vlc/libvlc_media.h
- include/vlc_input_item.h
- include/vlc_meta.h
- lib/media.c
- modules/demux/asf/asf.c
- modules/demux/mp4/libmp4.c
- modules/demux/mp4/libmp4.h
- modules/demux/mp4/meta.c
- modules/lua/libs/input.c
- modules/meta_engine/ID3Meta.h
- modules/meta_engine/taglib.cpp
- modules/misc/preparser_serializer/json/fromjson.c
- modules/misc/preparser_serializer/json/tojson.c
- src/input/meta.c
- test/libvlc/media.c


Changes:

=====================================
include/vlc/libvlc_media.h
=====================================
@@ -73,7 +73,8 @@ typedef enum libvlc_meta_t {
     libvlc_meta_Actors,
     libvlc_meta_AlbumArtist,
     libvlc_meta_DiscNumber,
-    libvlc_meta_DiscTotal
+    libvlc_meta_DiscTotal,
+    libvlc_meta_Compilation,
     /* Add new meta types HERE */
 } libvlc_meta_t;
 


=====================================
include/vlc_input_item.h
=====================================
@@ -337,6 +337,7 @@ INPUT_META(ShowName)
 INPUT_META(Actors)
 INPUT_META(DiscNumber)
 INPUT_META(DiscTotal)
+INPUT_META(Compilation)
 
 #define input_item_SetTrackNum input_item_SetTrackNumber
 #define input_item_GetTrackNum input_item_GetTrackNumber


=====================================
include/vlc_meta.h
=====================================
@@ -57,10 +57,11 @@ typedef enum vlc_meta_type_t
     vlc_meta_Actors,
     vlc_meta_AlbumArtist,
     vlc_meta_DiscNumber,
-    vlc_meta_DiscTotal
+    vlc_meta_DiscTotal,
+    vlc_meta_Compilation,
 } vlc_meta_type_t;
 
-#define VLC_META_TYPE_COUNT 27
+#define VLC_META_TYPE_COUNT 28
 
 typedef enum
 {
@@ -157,6 +158,7 @@ VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
 #define vlc_meta_SetActors( meta, b )      vlc_meta_Set( meta, vlc_meta_Actors, b )
 #define vlc_meta_SetAlbumArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_AlbumArtist, b )
 #define vlc_meta_SetDiscNumber( meta, b )  vlc_meta_Set( meta, vlc_meta_DiscNumber, b )
+#define vlc_meta_SetCompilation( meta, b ) vlc_meta_Set( meta, vlc_meta_Compilation, b )
 
 #define VLC_META_TITLE              vlc_meta_TypeToLocalizedString( vlc_meta_Title )
 #define VLC_META_ARTIST             vlc_meta_TypeToLocalizedString( vlc_meta_Artist )
@@ -182,6 +184,7 @@ VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
 #define VLC_META_ACTORS             vlc_meta_TypeToLocalizedString( vlc_meta_Actors )
 #define VLC_META_ALBUMARTIST        vlc_meta_TypeToLocalizedString( vlc_meta_AlbumArtist )
 #define VLC_META_DISCNUMBER         vlc_meta_TypeToLocalizedString( vlc_meta_DiscNumber )
+#define VLC_META_COMPILATION        vlc_meta_TypeToLocalizedString( vlc_meta_Compilation )
 
 #define VLC_META_EXTRA_MB_ALBUMID   "MB_ALBUMID"
 


=====================================
lib/media.c
=====================================
@@ -72,7 +72,8 @@ static const vlc_meta_type_t libvlc_to_vlc_meta[] =
     [libvlc_meta_Actors]       = vlc_meta_Actors,
     [libvlc_meta_AlbumArtist]  = vlc_meta_AlbumArtist,
     [libvlc_meta_DiscNumber]   = vlc_meta_DiscNumber,
-    [libvlc_meta_DiscTotal]    = vlc_meta_DiscTotal
+    [libvlc_meta_DiscTotal]    = vlc_meta_DiscTotal,
+    [libvlc_meta_Compilation]  = vlc_meta_Compilation,
 };
 
 static_assert(


=====================================
modules/demux/asf/asf.c
=====================================
@@ -1395,6 +1395,7 @@ static int DemuxInit( demux_t *p_demux )
             else set_meta( "WM/AlbumArtist",  vlc_meta_AlbumArtist )
             else set_meta( "WM/Publisher",    vlc_meta_Publisher )
             else set_meta( "WM/PartOfSet",    vlc_meta_DiscNumber )
+            else set_meta( "WM/IsCompilation", vlc_meta_Compilation )
             else if( p_ecd->ppsz_value[i] != NULL && p_ecd->ppsz_name[i] &&
                     *p_ecd->ppsz_value[i] != '\0' && /* no empty value */
                     *p_ecd->ppsz_value[i] != '{'  && /* no guid value */


=====================================
modules/demux/mp4/libmp4.c
=====================================
@@ -5247,6 +5247,7 @@ static const struct
     { ATOM_atID,    MP4_ReadBox_Metadata,    ATOM_ilst }, /* iTunes */
     { ATOM_cnID,    MP4_ReadBox_Metadata,    ATOM_ilst }, /* iTunes */
     { ATOM_covr,    MP4_ReadBoxContainer,    ATOM_ilst },
+    { ATOM_cpil,    MP4_ReadBox_Metadata,    ATOM_ilst },
     { ATOM_desc,    MP4_ReadBox_Metadata,    ATOM_ilst },
     { ATOM_disk,    MP4_ReadBox_Metadata,    ATOM_ilst },
     { ATOM_flvr,    MP4_ReadBox_Metadata,    ATOM_ilst },


=====================================
modules/demux/mp4/libmp4.h
=====================================
@@ -395,6 +395,7 @@ typedef int64_t stime_t;
 #define ATOM_0xa9xyz VLC_FOURCC( 0xa9, 'x', 'y', 'z' )
 #define ATOM_aART VLC_FOURCC( 'a', 'A', 'R', 'T' )
 #define ATOM_chpl VLC_FOURCC( 'c', 'h', 'p', 'l' )
+#define ATOM_cpil VLC_FOURCC( 'c', 'p', 'i', 'l' )
 #define ATOM_HMMT VLC_FOURCC( 'H', 'M', 'M', 'T' )
 #define ATOM_desc VLC_FOURCC( 'd', 'e', 's', 'c' )
 #define ATOM_disk VLC_FOURCC( 'd', 'i', 's', 'k' )


=====================================
modules/demux/mp4/meta.c
=====================================
@@ -470,6 +470,16 @@ static void SetupmdirMeta( vlc_meta_t *p_meta, const MP4_Box_t *p_box, void *pri
         }
         break;
     }
+    case ATOM_cpil:
+    {
+        if ( BOXDATA(p_data)->i_blob >= 1 &&
+             BOXDATA(p_data)->e_wellknowntype == DATA_WKT_BE_SIGNED )
+        {
+            vlc_meta_SetCompilation( p_meta,
+                                     *BOXDATA(p_data)->p_blob ? "1" : "0" );
+        }
+        break;
+    }
     case ATOM_disk:
     {
         if ( BOXDATA(p_data)->i_blob >= 6 &&


=====================================
modules/lua/libs/input.c
=====================================
@@ -795,6 +795,7 @@ static int vlclua_input_item_set_meta( lua_State *L )
         META_TYPE( AlbumArtist, "album_artist" )
         META_TYPE( DiscNumber, "disc_number" )
         META_TYPE( DiscTotal, "disc_total" )
+        META_TYPE( Compilation, "compilation" )
     };
 #undef META_TYPE
 


=====================================
modules/meta_engine/ID3Meta.h
=====================================
@@ -31,6 +31,7 @@ static struct
     const char *psz;
 } const ID3_tag_to_metatype[] = {
     { VLC_FOURCC('T', 'A', 'L', 'B'), vlc_meta_Album,       NULL },
+    { VLC_FOURCC('T', 'C', 'M', 'P'), vlc_meta_Compilation, NULL },
     { VLC_FOURCC('T', 'D', 'R', 'C'), vlc_meta_Date,        NULL },
     { VLC_FOURCC('T', 'E', 'N', 'C'), vlc_meta_extra,       "Encoder" },
     { VLC_FOURCC('T', 'I', 'T', '2'), vlc_meta_Title,       NULL },


=====================================
modules/meta_engine/taglib.cpp
=====================================
@@ -449,6 +449,7 @@ static void ReadMetaFromAPE( APE::Tag* tag, demux_meta_t* p_demux_meta, vlc_meta
     SET( "LANGUAGE", Language );
     SET( "PUBLISHER", Publisher );
     SET( "MUSICBRAINZ_TRACKID", TrackID );
+    SET( "COMPILATION", Compilation );
 
     SET_EXTRA( "MUSICBRAINZ_ALBUMID", VLC_META_EXTRA_MB_ALBUMID );
 
@@ -510,6 +511,10 @@ static void ReadMetaFromASF( ASF::Tag* tag, demux_meta_t* p_demux_meta, vlc_meta
 #undef SET
 #undef SET_EXTRA
 
+    if( tag->attributeListMap().contains("WM/IsCompilation") )
+        vlc_meta_SetCompilation( p_meta,
+            tag->attributeListMap()["WM/IsCompilation"].front().toBool() ? "1" : "0" );
+
     // List the pictures
     list = tag->attributeListMap()["WM/Picture"];
     ASF::AttributeList::Iterator iter;
@@ -767,6 +772,7 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_meta_t* p_demux_meta, vlc_
     SET( "TLAN", Language );
     SET( "TPUB", Publisher );
     SET( "TPE2", AlbumArtist );
+    SET( "TCMP", Compilation );
     SET_EXTRA( "USLT", "Lyrics" );
 
 #undef SET_EXTRA
@@ -826,6 +832,7 @@ static void ReadMetaFromXiph( Ogg::XiphComment* tag, demux_meta_t* p_demux_meta,
     SET( "MUSICBRAINZ_TRACKID", TrackID );
     SET( "ALBUMARTIST", AlbumArtist );
     SET( "DISCNUMBER", DiscNumber );
+    SET( "COMPILATION", Compilation );
 
     SET_EXTRA( "MUSICBRAINZ_ALBUMID", VLC_META_EXTRA_MB_ALBUMID );
 #undef SET
@@ -885,6 +892,9 @@ static void ReadMetaFromMP4( MP4::Tag* tag, demux_meta_t *p_demux_meta, vlc_meta
 #undef SET
 #undef SET_EXTRA
 
+    if( tag->contains("cpil") )
+        vlc_meta_SetCompilation( p_meta, tag->item("cpil").toBool() ? "1" : "0" );
+
     if( tag->contains("covr") )
     {
         MP4::CoverArtList cover_list = tag->item("covr").toCoverArtList();


=====================================
modules/misc/preparser_serializer/json/fromjson.c
=====================================
@@ -920,6 +920,7 @@ static void fromJSON_meta(struct serdes_sys *sys,
     meta_from_object(obj, meta, Actors, err);
     meta_from_object(obj, meta, DiscNumber, err);
     meta_from_object(obj, meta, DiscTotal, err);
+    meta_from_object(obj, meta, Compilation, err);
 
 #undef meta_from_object
 


=====================================
modules/misc/preparser_serializer/json/tojson.c
=====================================
@@ -798,6 +798,7 @@ static void toJSON_meta(struct serdes_sys *sys, const vlc_meta_t *meta,
     stringify_meta(sys, meta, Actors);
     stringify_meta(sys, meta, DiscNumber);
     stringify_meta(sys, meta, DiscTotal);
+    stringify_meta(sys, meta, Compilation);
 
 #undef stringify_meta
 


=====================================
src/input/meta.c
=====================================
@@ -81,7 +81,8 @@ const char *vlc_meta_TypeToString(vlc_meta_type_t meta_type)
         [vlc_meta_Actors]      = N_("Actors"),
         [vlc_meta_AlbumArtist] = N_("Album Artist"),
         [vlc_meta_DiscNumber]  = N_("Disc number"),
-        [vlc_meta_DiscTotal]   = N_("Total disc number")
+        [vlc_meta_DiscTotal]   = N_("Total disc number"),
+        [vlc_meta_Compilation] = N_("Compilation"),
     };
 
     assert(meta_type < ARRAY_SIZE(posix_names));


=====================================
test/libvlc/media.c
=====================================
@@ -100,7 +100,7 @@ static void print_media(libvlc_media_t *media)
         test_log("\tmedia doesn't have any tracks\n");
 
     for (enum libvlc_meta_t i = libvlc_meta_Title;
-         i <= libvlc_meta_DiscTotal; ++i)
+         i <= libvlc_meta_Compilation; ++i)
     {
         char *psz_meta = libvlc_media_get_meta(media, i);
         if (psz_meta != NULL)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/eafa0f92c641e34920f3480c55b66e0a911590f1...fd0afd490757ae0a4d736c638a6c975cdabd7ea9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/eafa0f92c641e34920f3480c55b66e0a911590f1...fd0afd490757ae0a4d736c638a6c975cdabd7ea9
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list