curlbasesink: don't send empty buffers
authorDavid Fernandez <d.fernandezlop@gmail.com>
Tue, 16 Feb 2016 14:10:34 +0000 (15:10 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 17 Feb 2016 11:10:22 +0000 (11:10 +0000)
Fixes problem in curlhttpsink when qtmux uses faststart.

https://bugzilla.gnome.org/show_bug.cgi?id=762013

ext/curl/gstcurlbasesink.c

index 58397a1..725f1ac 100644 (file)
@@ -349,12 +349,17 @@ gst_curl_base_sink_render (GstBaseSink * bsink, GstBuffer * buf)
 
   sink = GST_CURL_BASE_SINK (bsink);
 
-  GST_OBJECT_LOCK (sink);
-
   gst_buffer_map (buf, &map, GST_MAP_READ);
   data = map.data;
   size = map.size;
 
+  if (size == 0) {
+    gst_buffer_unmap (buf, &map);
+    return GST_FLOW_OK;
+  }
+
+  GST_OBJECT_LOCK (sink);
+
   /* check if the transfer thread has encountered problems while the
    * pipeline thread was working elsewhere */
   if (sink->flow_ret != GST_FLOW_OK) {