[vlc-commits] [Git][videolan/vlc][master] 3 commits: demux: playlist: refactor input_item_SetPublisher() call order to avoid double lock
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Aug 15 07:30:04 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
c69f69ff by Ayush Dey at 2024-08-15T07:16:19+00:00
demux: playlist: refactor input_item_SetPublisher() call order to avoid double lock
Moved the input_item_SetPublisher() call above the input_item_AddInfo() call. This change is
necessary for upcoming commits to prevent double locking issues.
- - - - -
86caaaf0 by Ayush Dey at 2024-08-15T07:16:19+00:00
input: add macro vlc_meta_SetWithPlaylistPriority
Add macro `vlc_meta_SetWithPlaylistPriority` to set metadata with the
priority of VLC_META_PRIORITY_PLAYLIST.
- - - - -
03625632 by Ayush Dey at 2024-08-15T07:16:19+00:00
demux: playlist: set the metadata priority of M3U files to VLC_META_PRIORITY_PLAYLIST
Replace input_item_Set* calls with vlc_meta_SetWithPlaylistPriority() calls, setting the priority
to VLC_META_PRIORITY_PLAYLIST. This change elevates the priority of the metadata parsed
from the M3U file, ensuring it is not overridden by metadata from subsequently played audio
files(having priority of VLC_META_PRIORITY_BASIC).
Fixes the bug where metadata parsed from the M3U file was being overridden by metadata from
subsequently played audio files.
- - - - -
2 changed files:
- include/vlc_meta.h
- modules/demux/playlist/m3u.c
Changes:
=====================================
include/vlc_meta.h
=====================================
@@ -124,6 +124,7 @@ 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
=====================================
@@ -231,18 +231,20 @@ static int CreateEntry( input_item_node_t *p_node, const struct entry_meta_s *me
input_item_AddOptions( p_input, meta->i_options, meta->ppsz_options, 0 );
+ vlc_mutex_lock( &p_input->lock );
if( meta->psz_artist )
- input_item_SetArtist( p_input, meta->psz_artist );
+ vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_Artist, meta->psz_artist );
if( meta->psz_name )
- input_item_SetTitle( p_input, meta->psz_name );
+ vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_Title, meta->psz_name );
if( meta->psz_album_art )
- input_item_SetArtURL( p_input, meta->psz_album_art );
+ vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_ArtworkURL, meta->psz_album_art );
if( meta->psz_language )
- input_item_SetLanguage( p_input, meta->psz_language );
+ vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_Language, meta->psz_language );
+ if( meta->psz_grouptitle )
+ vlc_meta_SetWithPlaylistPriority( p_input->p_meta, vlc_meta_Publisher, meta->psz_grouptitle );
+ vlc_mutex_unlock( &p_input->lock );
if( meta->psz_tvgid )
input_item_AddInfo( p_input, "XMLTV", "tvg-id", "%s", meta->psz_tvgid );
- if( meta->psz_grouptitle )
- input_item_SetPublisher( p_input, meta->psz_grouptitle );
input_item_node_AppendItem( p_node, p_input );
input_item_Release( p_input );
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b0d5b12e07daa41b8d17d32107c11dad4e694cec...03625632442e029760f6ada5dde28f7a85087f03
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b0d5b12e07daa41b8d17d32107c11dad4e694cec...03625632442e029760f6ada5dde28f7a85087f03
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