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

Lukas Solanka lsolanka at gmail.com
Wed Mar 22 00:38:13 CET 2017


Fixes the track title issue described in #4143, but does not deal with
track duration.

On 21 March 2017 at 23:21, Lukas Solanka <lsolanka at gmail.com> wrote:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170321/fd65ba1d/attachment.html>


More information about the vlc-devel mailing list