[FFmpeg-devel] [PATCH] matroskaenc: don't duplicate title information

Aurelien Jacobs aurel
Mon Nov 22 23:28:17 CET 2010


On Mon, Nov 22, 2010 at 09:24:39AM +0100, Anton Khirnov wrote:
> Title is already written into special fields designated for it --
> per-segment Title, per-chapter ChapString and per-stream Name (yay for
> consistent naming). Therefore, don't duplicate it in Tags.
> ---
>  libavformat/matroskaenc.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 1430228..598c253 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -742,7 +742,8 @@ static int mkv_write_tag(AVFormatContext *s, AVMetadata *m, unsigned int element
>      end_ebml_master(s->pb, targets);
>  
>      while ((t = av_metadata_get(m, "", t, AV_METADATA_IGNORE_SUFFIX)))
> -        mkv_write_simpletag(s->pb, t);
> +        if (strcmp(t->key, "title"))
> +            mkv_write_simpletag(s->pb, t);

Maybe you should use strcasecmp(). The separate code reading and setting
"title" don't use AV_METADATA_MATCH_CASE, so you should do the same
here.
And the reindentation may also be applied in a separate commit but I
don't insist on this for such a single line.

You can commit directly with those changes.

Oh, and if you want to go a little further, you may also want to filter
the "language" tag for AVStream as they are also written independently.

Aurel



More information about the ffmpeg-devel mailing list