qtdemux: boldly assume that first 'covr' image is the front cover

This commit is contained in:
Tim-Philipp Müller 2017-01-14 15:16:53 +00:00
parent 59fd44a56f
commit 5404304fac

View file

@ -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);