]> git.sesse.net Git - ffmpeg/commitdiff
id3v2: Do not export empty APIC description
authorwm4 <nfxjfg@googlemail.com>
Fri, 8 May 2015 16:19:12 +0000 (18:19 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 9 May 2015 13:55:50 +0000 (15:55 +0200)
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.

libavformat/id3v2.c

index b8994b2226334c6222eb3dc6d86eed2e811625c4..799eafee7cc1c7d1131f2ae8e7d38296ea971322 100644 (file)
@@ -763,7 +763,10 @@ 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);