[vlc-commits] [Git][videolan/vlc][master] 3 commits: demux: playlist: add a priority data member to struct entry_meta_s
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Nov 24 10:26:21 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
16fd627f by Ayush Dey at 2024-11-24T10:07:45+00:00
demux: playlist: add a priority data member to struct entry_meta_s
This is used to represent the priority of metadata for individual tracks in the m3u file.
This value will indicate whether the m3u file contains valid metadata for that track.
(VLC_META_PRIORITY_PLAYLIST if it does, VLC_META_PRIORITY_BASIC if it doesn't)
- - - - -
db7ea4c2 by Ayush Dey at 2024-11-24T10:07:45+00:00
demux: playlist: set VLC_META_PRIORITY_PLAYLIST after metadata parsing
Initialise priority with VLC_META_PRIORITY_BASIC. Set the priority to VLC_META_PRIORITY_PLAYLIST
when metadata is detected after the `#EXTINF` or `#EXTALBUMARTURL` directives.
- - - - -
3907bd7d by Ayush Dey at 2024-11-24T10:07:45+00:00
Revert "input: add macro vlc_meta_SetWithPlaylistPriority"
This reverts commit 86caaaf03ca99f4a18d02cbcc14ac95f4741b938.
As we are not using the vlc_meta_SetWithPlaylistPriority macro for now.
- - - - -
2 changed files:
- include/vlc_meta.h
- modules/demux/playlist/m3u.c
Changes:
=====================================
include/vlc_meta.h
=====================================
@@ -124,7 +124,6 @@ typedef struct meta_export_t
VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
#define vlc_meta_Set( meta, meta_type, b ) vlc_meta_SetWithPriority( meta, meta_type, b, VLC_META_PRIORITY_BASIC )
-#define vlc_meta_SetWithPlaylistPriority( meta, meta_type, b ) vlc_meta_SetWithPriority( meta, meta_type, b, VLC_META_PRIORITY_PLAYLIST )
#define vlc_meta_SetExtra( meta, psz_name, psz_value ) vlc_meta_SetExtraWithPriority( meta, psz_name, psz_value, VLC_META_PRIORITY_BASIC )
/* Setters for meta.
=====================================
modules/demux/playlist/m3u.c
=====================================
@@ -195,12 +195,14 @@ struct entry_meta_s
vlc_tick_t i_duration;
const char**ppsz_options;
int i_options;
+ vlc_meta_priority_t priority;
};
static void entry_meta_Init( struct entry_meta_s *e )
{
memset(e, 0, sizeof(*e));
e->i_duration = INPUT_DURATION_INDEFINITE;
+ e->priority = VLC_META_PRIORITY_BASIC;
}
static void entry_meta_Clean( struct entry_meta_s *e )
@@ -233,15 +235,15 @@ static int CreateEntry( input_item_node_t *p_node, const struct entry_meta_s *me
vlc_mutex_lock( &p_input->lock );
if( meta->psz_artist )
- vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_Artist, meta->psz_artist );
+ vlc_meta_SetWithPriority( p_input->p_meta, vlc_meta_Artist, meta->psz_artist, meta->priority );
if( meta->psz_name )
- vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_Title, meta->psz_name );
+ vlc_meta_SetWithPriority( p_input->p_meta, vlc_meta_Title, meta->psz_name, meta->priority );
if( meta->psz_album_art )
- vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_ArtworkURL, meta->psz_album_art );
+ vlc_meta_SetWithPriority( p_input->p_meta, vlc_meta_ArtworkURL, meta->psz_album_art, meta->priority );
if( meta->psz_language )
- vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_Language, meta->psz_language );
+ vlc_meta_SetWithPriority( p_input->p_meta, vlc_meta_Language, meta->psz_language, meta->priority );
if( meta->psz_grouptitle )
- vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_Publisher, meta->psz_grouptitle );
+ vlc_meta_SetWithPriority( p_input->p_meta, vlc_meta_Publisher, meta->psz_grouptitle, meta->priority );
vlc_mutex_unlock( &p_input->lock );
if( meta->psz_tvgid )
input_item_AddInfo( p_input, "XMLTV", "tvg-id", "%s", meta->psz_tvgid );
@@ -286,6 +288,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
psz_parse += sizeof("EXTINF:") - 1;
meta.i_duration = INPUT_DURATION_INDEFINITE;
parseEXTINF( psz_parse, pf_dup, &meta );
+ meta.priority = VLC_META_PRIORITY_PLAYLIST;
}
else if( !strncasecmp( psz_parse, "EXTGRP:", sizeof("EXTGRP:") -1 ) )
{
@@ -317,6 +320,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
{
free( meta.psz_album_art );
meta.psz_album_art = pf_dup( psz_parse );
+ meta.priority = VLC_META_PRIORITY_PLAYLIST;
}
}
else if ( !strncasecmp( psz_parse, "PLAYLIST:",
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/eb5c78524595999f05ef3d5c25b2b83ef2dddd2b...3907bd7de82245079d689841261fb11a38911f11
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/eb5c78524595999f05ef3d5c25b2b83ef2dddd2b...3907bd7de82245079d689841261fb11a38911f11
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