queue: avoid return flushing if we have a not-linked
authorThiago Santos <thiagossantos@gmail.com>
Wed, 15 Mar 2017 05:18:36 +0000 (22:18 -0700)
committerThiago Santos <thiagossantos@gmail.com>
Wed, 15 Mar 2017 05:20:04 +0000 (22:20 -0700)
Return the correct flow return instead of returning always flushing.
This would cause queue to convert not-linked to flushing and making
upstream elements stop.

Based on the previous patch for queue2.

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

plugins/elements/gstqueue.c

index e98c1f6..db02e20 100644 (file)
@@ -1465,15 +1465,19 @@ no_item:
   }
 out_flushing:
   {
-    GST_CAT_LOG_OBJECT (queue_dataflow, queue, "exit because we are flushing");
-    return GST_FLOW_FLUSHING;
+    GstFlowReturn ret = queue->srcresult;
+    GST_CAT_LOG_OBJECT (queue_dataflow, queue,
+        "exit because task paused, reason: %s", gst_flow_get_name (ret));
+    return ret;
   }
 out_flushing_query:
   {
+    GstFlowReturn ret = queue->srcresult;
     queue->last_query = FALSE;
     g_cond_signal (&queue->query_handled);
-    GST_CAT_LOG_OBJECT (queue_dataflow, queue, "exit because we are flushing");
-    return GST_FLOW_FLUSHING;
+    GST_CAT_LOG_OBJECT (queue_dataflow, queue,
+        "exit because task paused, reason: %s", gst_flow_get_name (ret));
+    return ret;
   }
 }