diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2013-12-16 16:17:07 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2013-12-17 12:20:58 +0100 |
commit | 77c1b0aac19e9db6253f16b8a0343e0e1784688e (patch) | |
tree | 9f04a0bc9b1b7c5c3062288b91ed1a634a69aed5 | |
parent | caa52e71be4c7d404607ba2631ea1b6c3390f4fa (diff) |
id3v2mux: Set picture type in the APIC frames
-rw-r--r-- | ext/taglib/gstid3v2mux.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/taglib/gstid3v2mux.cc b/ext/taglib/gstid3v2mux.cc index 677213037e..27f4c803f4 100644 --- a/ext/taglib/gstid3v2mux.cc +++ b/ext/taglib/gstid3v2mux.cc @@ -458,11 +458,25 @@ add_image_tag (ID3v2::Tag * id3v2tag, const GstTagList * list, frame->setDescription ((desc) ? desc : ""); - /* FIXME set image type properly from caps */ if (strcmp (tag, GST_TAG_PREVIEW_IMAGE) == 0) { frame->setType (ID3v2::AttachedPictureFrame::FileIcon); } else { - frame->setType (ID3v2::AttachedPictureFrame::Other); + int image_type; + + if (info_struct) { + if (gst_structure_get (info_struct, "image-type", + GST_TYPE_TAG_IMAGE_TYPE, &image_type, NULL)) { + if (image_type > 0 && image_type <= 18) { + image_type += 2; + } else { + image_type = ID3v2::AttachedPictureFrame::Other; + } + } else { + image_type = ID3v2::AttachedPictureFrame::Other; + } + } + + frame->setType ((TagLib::ID3v2::AttachedPictureFrame::Type) image_type); } } } else { |