From 5404304facbec97e8d6d31370b8ea6ba89572336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 14 Jan 2017 15:16:53 +0000 Subject: [PATCH] qtdemux: boldly assume that first 'covr' image is the front cover --- gst/isomp4/qtdemux.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index ef680ca0b3..d4fb29204b 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -12113,9 +12113,16 @@ qtdemux_tag_add_covr (GstQTDemux * qtdemux, GstTagList * taglist, type = QT_UINT32 ((guint8 *) data->data + 8); GST_DEBUG_OBJECT (qtdemux, "have covr tag, type=%d,len=%d", type, len); if ((type == 0x0000000d || type == 0x0000000e) && len > 16) { + GstTagImageType image_type; + + if (gst_tag_list_get_tag_size (taglist, GST_TAG_IMAGE) == 0) + image_type = GST_TAG_IMAGE_TYPE_FRONT_COVER; + else + image_type = GST_TAG_IMAGE_TYPE_NONE; + if ((sample = gst_tag_image_data_to_image_sample ((guint8 *) data->data + 16, - len - 16, GST_TAG_IMAGE_TYPE_NONE))) { + len - 16, image_type))) { GST_DEBUG_OBJECT (qtdemux, "adding tag size %d", len - 16); gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, tag1, sample, NULL); gst_sample_unref (sample);