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

Rémi Denis-Courmont remi at remlab.net
Wed Mar 22 09:43:01 CET 2017


Le tiistaina 21. maaliskuuta 2017, 23.21.14 EET Lukas Solanka a écrit :
> 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] );

This becomes a no-op.

>              dst->ppsz_meta[i] = strdup( src->ppsz_meta[i] );


-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list