[vlc-devel] [PATCH] meta: merge only meta data not previously inserted

Lukas Solanka lsolanka at gmail.com
Wed Mar 22 00:21:14 CET 2017


This applies mostly to cue+single file flac situations when the flac file does
not have appropriate metadata. In those cases the track title coming from the
cue file is overwritten by the title from the flac file (usually album name and
not track name). This patch prevents that and keeps to original metadata, but
allows to insert new fields if necessary.
---
 src/input/meta.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/input/meta.c b/src/input/meta.c
index 9b79d42..8bf0baf 100644
--- a/src/input/meta.c
+++ b/src/input/meta.c
@@ -181,7 +181,8 @@ void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src )
 
     for( int i = 0; i < VLC_META_TYPE_COUNT; i++ )
     {
-        if( src->ppsz_meta[i] )
+        /* Merge only meta not inserted before by someone else */
+        if( !dst->ppsz_meta[i] && src->ppsz_meta[i] )
         {
             free( dst->ppsz_meta[i] );
             dst->ppsz_meta[i] = strdup( src->ppsz_meta[i] );
-- 
2.5.0



More information about the vlc-devel mailing list