multiqueue: Remove unused variable and simplify code

oldid was only used when we were doing multiple pops per loop.
This commit is contained in:
Edward Hervey 2010-10-08 12:54:52 +02:00
parent 1eee5e799d
commit 518364e7ac

View file

@ -1016,7 +1016,6 @@ gst_multi_queue_loop (GstPad * pad)
GstMultiQueue *mq; GstMultiQueue *mq;
GstMiniObject *object; GstMiniObject *object;
guint32 newid; guint32 newid;
guint32 oldid = G_MAXUINT32;
GstFlowReturn result; GstFlowReturn result;
sq = (GstSingleQueue *) gst_pad_get_element_private (pad); sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
@ -1036,16 +1035,14 @@ gst_multi_queue_loop (GstPad * pad)
object = gst_multi_queue_item_steal_object (item); object = gst_multi_queue_item_steal_object (item);
gst_multi_queue_item_destroy (item); gst_multi_queue_item_destroy (item);
GST_LOG_OBJECT (mq, "SingleQueue %d : newid:%d , oldid:%d", GST_LOG_OBJECT (mq, "SingleQueue %d : newid:%d", sq->id, newid);
sq->id, newid, oldid);
/* If we're not-linked, we do some extra work because we might need to /* If we're not-linked, we do some extra work because we might need to
* wait before pushing. If we're linked but there's a gap in the IDs, * wait before pushing. If we're linked but there's a gap in the IDs,
* or it's the first loop, or we just passed the previous highid, * or it's the first loop, or we just passed the previous highid,
* we might need to wake some sleeping pad up, so there's extra work * we might need to wake some sleeping pad up, so there's extra work
* there too */ * there too */
if (sq->srcresult == GST_FLOW_NOT_LINKED || if (sq->srcresult == GST_FLOW_NOT_LINKED) {
(oldid == G_MAXUINT32) || (newid != (oldid + 1)) || oldid > mq->highid) {
GST_LOG_OBJECT (mq, "CHECKING sq->srcresult: %s", GST_LOG_OBJECT (mq, "CHECKING sq->srcresult: %s",
gst_flow_get_name (sq->srcresult)); gst_flow_get_name (sq->srcresult));
@ -1054,10 +1051,6 @@ gst_multi_queue_loop (GstPad * pad)
/* Update the nextid so other threads know when to wake us up */ /* Update the nextid so other threads know when to wake us up */
sq->nextid = newid; sq->nextid = newid;
/* Update the oldid (the last ID we output) for highid tracking */
if (oldid != G_MAXUINT32)
sq->oldid = oldid;
if (sq->srcresult == GST_FLOW_NOT_LINKED) { if (sq->srcresult == GST_FLOW_NOT_LINKED) {
/* Go to sleep until it's time to push this buffer */ /* Go to sleep until it's time to push this buffer */
@ -1098,6 +1091,7 @@ gst_multi_queue_loop (GstPad * pad)
/* Try to push out the new object */ /* Try to push out the new object */
result = gst_single_queue_push_one (mq, sq, object); result = gst_single_queue_push_one (mq, sq, object);
sq->srcresult = result; sq->srcresult = result;
sq->oldid = newid;
if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED
&& result != GST_FLOW_UNEXPECTED) && result != GST_FLOW_UNEXPECTED)
@ -1106,8 +1100,6 @@ gst_multi_queue_loop (GstPad * pad)
GST_LOG_OBJECT (mq, "AFTER PUSHING sq->srcresult: %s", GST_LOG_OBJECT (mq, "AFTER PUSHING sq->srcresult: %s",
gst_flow_get_name (sq->srcresult)); gst_flow_get_name (sq->srcresult));
oldid = newid;
return; return;
out_flushing: out_flushing: