matroska: Treat non-image structure as attachment

Otherwise each structure is named as GstTagImageInfo even if
it does not contain any images which is misleading.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1205>
This commit is contained in:
Rafał Dzięgiel 2021-01-20 11:33:39 +01:00 committed by GStreamer Marge Bot
parent 8c35850f23
commit 0ba65a00c9

View file

@ -851,9 +851,11 @@ gst_matroska_read_common_parse_attached_file (GstMatroskaReadCommon * common,
}
/* Set filename and description in the info */
if (info == NULL)
info = gst_structure_new_empty ("GstTagImageInfo");
if (info == NULL) {
const gchar *structure_name = (image_type != GST_TAG_IMAGE_TYPE_NONE) ?
"GstTagImageInfo" : "GstTagAttachmentInfo";
info = gst_structure_new_empty (structure_name);
}
gst_structure_set (info, "filename", G_TYPE_STRING, filename, NULL);
if (description)
gst_structure_set (info, "description", G_TYPE_STRING, description, NULL);