mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
queue: don't ignore event return value
Pass the event return value upstream. Remove strange goto construct.
This commit is contained in:
parent
12b3a37b5e
commit
e5a73cc2ff
2 changed files with 14 additions and 18 deletions
|
@ -758,16 +758,16 @@ no_item:
|
|||
static gboolean
|
||||
gst_queue_handle_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
gboolean ret = TRUE;
|
||||
GstQueue *queue;
|
||||
|
||||
queue = GST_QUEUE (parent);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_FLUSH_START:
|
||||
{
|
||||
STATUS (queue, pad, "received flush start event");
|
||||
/* forward event */
|
||||
gst_pad_push_event (queue->srcpad, event);
|
||||
ret = gst_pad_push_event (queue->srcpad, event);
|
||||
|
||||
/* now unblock the chain function */
|
||||
GST_QUEUE_MUTEX_LOCK (queue);
|
||||
|
@ -783,13 +783,11 @@ gst_queue_handle_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
* flush_start downstream. */
|
||||
gst_pad_pause_task (queue->srcpad);
|
||||
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "loop stopped");
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
{
|
||||
STATUS (queue, pad, "received flush stop event");
|
||||
/* forward event */
|
||||
gst_pad_push_event (queue->srcpad, event);
|
||||
ret = gst_pad_push_event (queue->srcpad, event);
|
||||
|
||||
GST_QUEUE_MUTEX_LOCK (queue);
|
||||
gst_queue_locked_flush (queue, FALSE);
|
||||
|
@ -801,8 +799,7 @@ gst_queue_handle_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
||||
STATUS (queue, pad, "after flush");
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (GST_EVENT_IS_SERIALIZED (event)) {
|
||||
/* serialized events go in the queue */
|
||||
|
@ -824,12 +821,11 @@ gst_queue_handle_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
} else {
|
||||
/* non-serialized events are forwarded downstream immediately */
|
||||
gst_pad_push_event (queue->srcpad, event);
|
||||
ret = gst_pad_push_event (queue->srcpad, event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
done:
|
||||
return TRUE;
|
||||
return ret;
|
||||
|
||||
/* ERRORS */
|
||||
out_eos:
|
||||
|
|
|
@ -2186,6 +2186,7 @@ static gboolean
|
|||
gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
|
||||
GstEvent * event)
|
||||
{
|
||||
gboolean ret = TRUE;
|
||||
GstQueue2 *queue;
|
||||
|
||||
queue = GST_QUEUE2 (parent);
|
||||
|
@ -2196,7 +2197,7 @@ gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
|
|||
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "received flush start event");
|
||||
if (GST_PAD_MODE (queue->srcpad) == GST_PAD_MODE_PUSH) {
|
||||
/* forward event */
|
||||
gst_pad_push_event (queue->srcpad, event);
|
||||
ret = gst_pad_push_event (queue->srcpad, event);
|
||||
|
||||
/* now unblock the chain function */
|
||||
GST_QUEUE2_MUTEX_LOCK (queue);
|
||||
|
@ -2224,7 +2225,7 @@ gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
|
|||
|
||||
gst_event_unref (event);
|
||||
}
|
||||
goto done;
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
{
|
||||
|
@ -2232,7 +2233,7 @@ gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
|
|||
|
||||
if (GST_PAD_MODE (queue->srcpad) == GST_PAD_MODE_PUSH) {
|
||||
/* forward event */
|
||||
gst_pad_push_event (queue->srcpad, event);
|
||||
ret = gst_pad_push_event (queue->srcpad, event);
|
||||
|
||||
GST_QUEUE2_MUTEX_LOCK (queue);
|
||||
gst_queue2_locked_flush (queue, FALSE);
|
||||
|
@ -2257,7 +2258,7 @@ gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
|
|||
|
||||
gst_event_unref (event);
|
||||
}
|
||||
goto done;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (GST_EVENT_IS_SERIALIZED (event)) {
|
||||
|
@ -2270,12 +2271,11 @@ gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
|
|||
GST_QUEUE2_MUTEX_UNLOCK (queue);
|
||||
} else {
|
||||
/* non-serialized events are passed upstream. */
|
||||
gst_pad_push_event (queue->srcpad, event);
|
||||
ret = gst_pad_push_event (queue->srcpad, event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
done:
|
||||
return TRUE;
|
||||
return ret;
|
||||
|
||||
/* ERRORS */
|
||||
out_flushing:
|
||||
|
|
Loading…
Reference in a new issue