queue2: if buffering is disabled while buffering, post 100% message
authorThiago Santos <ts.santos@sisa.samsung.com>
Mon, 10 Mar 2014 13:00:28 +0000 (10:00 -0300)
committerThiago Santos <ts.santos@sisa.samsung.com>
Mon, 10 Mar 2014 13:10:24 +0000 (10:10 -0300)
Avoids stall waiting for buffering to reach 100%

plugins/elements/gstqueue2.c

index d04b9b74cf5d615fcf05a5b29ac967512259fd85..00dd57296f2ef322139ac257fa92400b63f9e059 100644 (file)
@@ -3385,6 +3385,15 @@ gst_queue2_set_property (GObject * object,
       break;
     case PROP_USE_BUFFERING:
       queue->use_buffering = g_value_get_boolean (value);
+      if (!queue->use_buffering && queue->is_buffering) {
+        GstMessage *msg = gst_message_new_buffering (GST_OBJECT_CAST (queue),
+            100);
+
+        GST_DEBUG_OBJECT (queue, "Disabled buffering while buffering, "
+            "posting 100%% message");
+        queue->is_buffering = FALSE;
+        gst_element_post_message (GST_ELEMENT_CAST (queue), msg);
+      }
       break;
     case PROP_USE_RATE_ESTIMATE:
       queue->use_rate_estimate = g_value_get_boolean (value);