multiqueue: return upon input when already eos

... rather than hanging incoming thread (as considered full in eos).
This commit is contained in:
Mark Nauwelaerts 2010-12-02 17:51:58 +01:00
parent efe3c70450
commit e0f15e666a

View file

@ -1154,6 +1154,10 @@ gst_multi_queue_chain (GstPad * pad, GstBuffer * buffer)
sq = gst_pad_get_element_private (pad);
mq = sq->mqueue;
/* if eos, we are always full, so avoid hanging incoming indefinitely */
if (sq->is_eos)
goto was_eos;
/* Get a unique incrementing id */
curid = mq->counter++;
@ -1183,6 +1187,12 @@ flushing:
gst_multi_queue_item_destroy (item);
goto done;
}
was_eos:
{
GST_DEBUG_OBJECT (mq, "we are EOS, dropping buffer, return UNEXPECTED");
gst_buffer_unref (buffer);
return GST_FLOW_UNEXPECTED;
}
}
static gboolean
@ -1250,6 +1260,10 @@ gst_multi_queue_sink_event (GstPad * pad, GstEvent * event)
break;
}
/* if eos, we are always full, so avoid hanging incoming indefinitely */
if (sq->is_eos)
goto was_eos;
/* Get an unique incrementing id. protected with the STREAM_LOCK, unserialized
* events already got pushed and don't end up in the queue. */
curid = mq->counter++;
@ -1294,6 +1308,13 @@ flushing:
gst_multi_queue_item_destroy (item);
goto done;
}
was_eos:
{
GST_DEBUG_OBJECT (mq, "we are EOS, dropping event, return FALSE");
gst_event_unref (event);
res = FALSE;
goto done;
}
}
static GstCaps *