Fixed the queueing algorithm.
Original commit message from CVS: Fixed the queueing algorithm.
This commit is contained in:
parent
4771dfa4ca
commit
39daed4c1e
@ -1,3 +1,10 @@
|
|||||||
|
2005-10-31 Zeeshan Ali <zeenix@gmail.com>
|
||||||
|
|
||||||
|
* gst-libs/gst/rtp/gstbasertpdepayload.c:
|
||||||
|
(gst_base_rtp_depayload_add_to_queue),
|
||||||
|
(gst_base_rtp_depayload_push):
|
||||||
|
Fixed the queueing algorithm.
|
||||||
|
|
||||||
2005-10-31 Zeeshan Ali <zeenix@gmail.com>
|
2005-10-31 Zeeshan Ali <zeenix@gmail.com>
|
||||||
|
|
||||||
* gst-libs/gst/rtp/gstbasertpdepayload.c:
|
* gst-libs/gst/rtp/gstbasertpdepayload.c:
|
||||||
|
@ -226,18 +226,18 @@ gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter,
|
|||||||
seqnum = gst_rtpbuffer_get_seq (in);
|
seqnum = gst_rtpbuffer_get_seq (in);
|
||||||
queueseq = gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_head (queue)));
|
queueseq = gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_head (queue)));
|
||||||
|
|
||||||
/* not our first packet
|
|
||||||
* let us make sure it is not very late */
|
|
||||||
if (seqnum < queueseq)
|
|
||||||
goto too_late;
|
|
||||||
|
|
||||||
/* look for right place to insert it */
|
/* look for right place to insert it */
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (seqnum < queueseq) {
|
while (seqnum > queueseq) {
|
||||||
|
gpointer data;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
queueseq =
|
data = g_queue_peek_nth (queue, i);
|
||||||
gst_rtpbuffer_get_seq (GST_BUFFER (g_queue_peek_nth (queue, i)));
|
if (!data)
|
||||||
|
break;
|
||||||
|
|
||||||
|
queueseq = gst_rtpbuffer_get_seq (GST_BUFFER (data));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now insert it at that place */
|
/* now insert it at that place */
|
||||||
@ -251,14 +251,6 @@ gst_base_rtp_depayload_add_to_queue (GstBaseRTPDepayload * filter,
|
|||||||
g_queue_get_length (queue), i, timestamp, seqnum);
|
g_queue_get_length (queue), i, timestamp, seqnum);
|
||||||
}
|
}
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
too_late:
|
|
||||||
{
|
|
||||||
QUEUE_UNLOCK (filter);
|
|
||||||
/* we need to drop this one */
|
|
||||||
GST_DEBUG ("Packet arrived to late, dropping");
|
|
||||||
return GST_FLOW_OK;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user