From b697b297b77f73c932307120e32c187d521d2ff7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 7 May 2015 23:56:36 +0200 Subject: [PATCH] id3v2: do not export APIC description if empty APIC tags always have a description. Tag writers obviously leave it empty if there is no description. In this case, libavformat would export "" as title. Do not set the title instead. Signed-off-by: Michael Niedermayer --- libavformat/id3v2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index a8273e282c1..1c57dd9c431 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -1082,7 +1082,8 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta) st->disposition |= AV_DISPOSITION_ATTACHED_PIC; st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = apic->id; - av_dict_set(&st->metadata, "title", apic->description, 0); + if (apic->description[0]) + av_dict_set(&st->metadata, "title", apic->description, 0); av_dict_set(&st->metadata, "comment", apic->type, 0); av_init_packet(&st->attached_pic); -- 2.39.2