matroskademux: Make gst_byte_reader_get_data() usage less confusing
authorSebastian Dröge <sebastian@centricular.com>
Fri, 17 Mar 2023 15:13:39 +0000 (17:13 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 18 Mar 2023 19:52:40 +0000 (19:52 +0000)
This is effectively the same behaviour but retrieving 0 bytes of data is
confusing to read.

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

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

index 6fadbba..0e9d0b6 100644 (file)
@@ -592,8 +592,9 @@ gst_matroska_parse_protection_meta (gpointer * data_out, gsize * size_out,
     gst_structure_set (info_protect, "subsample_count", G_TYPE_UINT, 0, NULL);
   }
 
-  gst_byte_reader_get_data (&reader, 0, (const guint8 **) data_out);
   *size_out = gst_byte_reader_get_remaining (&reader);
+  gst_byte_reader_get_data (&reader, *size_out, (const guint8 **) data_out);
+
   return TRUE;
 
 release_err: