vorbistag: Read image-type from the GstSample info struct

But for backwards compatibility keep reading it from the caps and only
use the info struct if the caps don't contain the image-type.
This commit is contained in:
Sebastian Dröge 2013-12-16 11:35:12 +01:00
parent b5d26f3907
commit 5a48fb7cdb

View file

@ -568,10 +568,23 @@ gst_tag_to_metadata_block_picture (const gchar * tag,
mime_type = "-->";
mime_type_len = strlen (mime_type);
/* FIXME 2.0: Remove the image-type reading from the caps, this was
* a bug until 1.2.2. The image-type is only supposed to be in the
* info structure */
gst_structure_get (mime_struct, "image-type", GST_TYPE_TAG_IMAGE_TYPE,
&image_type, "width", G_TYPE_INT, &width, "height", G_TYPE_INT, &height,
NULL);
if (image_type == GST_TAG_IMAGE_TYPE_NONE) {
const GstStructure *info_struct;
info_struct = gst_sample_get_info (sample);
if (info_struct && gst_structure_has_name (info_struct, "GstTagImageInfo")) {
gst_structure_get (info_struct, "image-type", GST_TYPE_TAG_IMAGE_TYPE,
&image_type, NULL);
}
}
metadata_block_len = 32 + mime_type_len + gst_buffer_get_size (buffer);
gst_byte_writer_init_with_size (&writer, metadata_block_len, TRUE);