diff --git a/ext/taglib/gstid3v2mux.cc b/ext/taglib/gstid3v2mux.cc index c345142c1b..677213037e 100644 --- a/ext/taglib/gstid3v2mux.cc +++ b/ext/taglib/gstid3v2mux.cc @@ -427,8 +427,14 @@ add_image_tag (ID3v2::Tag * id3v2tag, const GstTagList * list, mime_type = gst_structure_get_name (s); if (mime_type != NULL) { ID3v2::AttachedPictureFrame * frame; - const gchar *desc; + const gchar *desc = NULL; GstMapInfo map; + const GstStructure *info_struct; + + info_struct = gst_sample_get_info (sample); + if (!info_struct + || !gst_structure_has_name (info_struct, "GstTagImageInfo")) + info_struct = NULL; if (strcmp (mime_type, "text/uri-list") == 0) mime_type = "-->"; @@ -447,7 +453,9 @@ add_image_tag (ID3v2::Tag * id3v2tag, const GstTagList * list, gst_buffer_unmap (image, &map); - desc = gst_structure_get_string (s, "image-description"); + if (info_struct) + desc = gst_structure_get_string (info_struct, "image-description"); + frame->setDescription ((desc) ? desc : ""); /* FIXME set image type properly from caps */