mxfmux: Add all local tags to the primer
authorSebastian Dröge <sebastian@centricular.com>
Mon, 9 Jan 2023 10:39:55 +0000 (12:39 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 10 Jan 2023 11:10:10 +0000 (11:10 +0000)
No matter if they're allocated via GSlice or malloc(). The allocator is
completely irrelevant, all local tags need to be in the primer so they
can be handled.

This didn't have any effect in practice because all local tags that
appear in the muxer are allocated via GSlice. Only from the demuxer they
might be allocated via malloc().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3699>

subprojects/gst-plugins-bad/gst/mxf/mxfmetadata.c

index 298f059..a56d436 100644 (file)
@@ -246,10 +246,10 @@ mxf_metadata_base_to_buffer (MXFMetadataBase * self, MXFPrimerPack * primer)
     g_hash_table_iter_init (&iter, self->other_tags);
 
     while (g_hash_table_iter_next (&iter, NULL, (gpointer) & t)) {
+      mxf_primer_pack_add_mapping (primer, 0x0000, &t->ul);
       tmp = g_slice_dup (MXFLocalTag, t);
       if (t->g_slice) {
         tmp->data = g_slice_alloc (t->size);
-        mxf_primer_pack_add_mapping (primer, 0x0000, &t->ul);
         memcpy (tmp->data, t->data, t->size);
       } else {
         tmp->data = g_memdup2 (t->data, t->size);