oggmux: set collectpads2 not to wait on sparse streams
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Tue, 1 Nov 2011 15:21:54 +0000 (15:21 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 25 Nov 2011 16:11:01 +0000 (16:11 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=663174

ext/ogg/gstoggmux.c

index 5341d6c..06133e3 100644 (file)
@@ -465,7 +465,7 @@ gst_ogg_mux_request_new_pad (GstElement * element,
 
       oggpad = (GstOggPadData *)
           gst_collect_pads2_add_pad_full (ogg_mux->collect, newpad,
-          sizeof (GstOggPadData), gst_ogg_mux_ogg_pad_destroy_notify, TRUE);
+          sizeof (GstOggPadData), gst_ogg_mux_ogg_pad_destroy_notify, FALSE);
       ogg_mux->active_pads++;
 
       oggpad->map.serialno = serial;
@@ -987,6 +987,12 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux, gboolean * popped)
             } else {
               GST_DEBUG_OBJECT (pad, "caps detected: %" GST_PTR_FORMAT,
                   pad->map.caps);
+
+              if (pad->map.is_sparse) {
+                GST_DEBUG_OBJECT (pad, "Pad is sparse, marking as such");
+                gst_collect_pads2_set_waiting (ogg_mux->collect,
+                    (GstCollectData2 *) pad, FALSE);
+              }
             }
           }
 
@@ -1339,8 +1345,8 @@ gst_ogg_mux_send_headers (GstOggMux * mux)
 
     GST_LOG_OBJECT (mux, "looking at pad %s:%s", GST_DEBUG_PAD_NAME (thepad));
 
-    /* if the pad has no buffer, we don't care */
-    if (pad->buffer == NULL)
+    /* if the pad has no buffer and is not sparse, we don't care */
+    if (pad->buffer == NULL && !pad->map.is_sparse)
       continue;
 
     /* now figure out the headers */