matroskamux: make sure pads caps are set before any buffers pushed.
authorZaheer Abbas Merali <zaheerabbas@merali.org>
Fri, 21 May 2010 12:25:24 +0000 (13:25 +0100)
committerZaheer Abbas Merali <zaheerabbas@merali.org>
Tue, 1 Jun 2010 15:43:03 +0000 (16:43 +0100)
gst/matroska/matroska-mux.c

index 1a15ee5..2fc52d9 100644 (file)
@@ -2007,6 +2007,17 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
   GTimeVal time = { 0, 0 };
   GstBuffer *streamheader_buffer;
 
+  /* set initial pad caps */
+  {
+    GstCaps *caps;
+    if (!strcmp (mux->doctype, GST_MATROSKA_DOCTYPE_WEBM)) {
+      caps = gst_caps_from_string ("video/webm");
+    } else {
+      caps = gst_caps_from_string ("video/x-matroska");
+    }
+    gst_pad_set_caps (mux->srcpad, caps);
+    gst_caps_unref (caps);
+  }
   /* we start with a EBML header */
   doctype = mux->doctype;
   GST_INFO_OBJECT (ebml, "DocType: %s, Version: %d",