queue2: Reset result flow when retrying
authorEdward Hervey <edward@centricular.com>
Mon, 22 Oct 2018 11:45:52 +0000 (13:45 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 22 Oct 2018 11:52:30 +0000 (13:52 +0200)
If we ever get a GST_FLOW_EOS from downstream, we might retry
pushing new data. But if pushing that data doesn't return a
GstFlowReturn (such as pushing events), we would end up returning
the previous GstFlowReturn (i.e. EOS).

Not properly resetting it would cause cases where queue2 would
stop pushing on the first GstEvent stored (even if there is more
data contained within).

plugins/elements/gstqueue2.c

index 537d4a8..bc3627f 100644 (file)
@@ -2908,7 +2908,7 @@ gst_queue2_dequeue_on_eos (GstQueue2 * queue, GstQueue2ItemType * item_type)
 static GstFlowReturn
 gst_queue2_push_one (GstQueue2 * queue)
 {
-  GstFlowReturn result = queue->srcresult;
+  GstFlowReturn result;
   GstMiniObject *data;
   GstQueue2ItemType item_type;
 
@@ -2917,6 +2917,7 @@ gst_queue2_push_one (GstQueue2 * queue)
     goto no_item;
 
 next:
+  result = queue->srcresult;
   STATUS (queue, queue->srcpad, "We have something dequeud");
   g_atomic_int_set (&queue->downstream_may_block,
       item_type == GST_QUEUE2_ITEM_TYPE_BUFFER ||