oggstream: Add a default GstOggMap
authorEdward Hervey <edward@centricular.com>
Wed, 1 Nov 2017 17:24:11 +0000 (18:24 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 1 Nov 2017 17:39:26 +0000 (18:39 +0100)
Since the default value of a GstOggPad.map.map was 0 ... we would
end up using wrong functions from mappers() if the stream wasn't
initialized yet.

Instead of that, use a default blank/empty first entry.

ext/ogg/gstoggstream.c

index d477397..b4ee557 100644 (file)
@@ -2241,6 +2241,23 @@ extract_tags_daala (GstOggStream * pad, ogg_packet * packet)
 /* indent hates our freedoms */
 const GstOggMap mappers[] = {
   {
+    /* Empty mapper for uninitialized pads/streams */
+    NULL, 0, G_MAXINT32,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+  },
+  {
     "\200theora", 7, 42,
     "video/x-theora",
     setup_theora_mapper,