matroska: Treat non-image structure as attachment
authorRafał Dzięgiel <rafostar.github@gmail.com>
Wed, 20 Jan 2021 10:33:39 +0000 (11:33 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 21 Oct 2021 21:42:00 +0000 (21:42 +0000)
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>

subprojects/gst-plugins-good/gst/matroska/matroska-read-common.c

index 062044f..d83ca12 100644 (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);