mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
id3v2mux: Set picture type in the APIC frames
This commit is contained in:
parent
d60ac3cfea
commit
92c3211c79
1 changed files with 16 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue