mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
rtpjitterbuffer: send lost event before signaling next buffer
First send the lost event, then update the next_seqnum counter and then send the signal to the pushing thread that it can retry to push a buffer. This avoids pushing out buffers before the lost event is pushed.
This commit is contained in:
parent
5051f51f0a
commit
0b1a7edfea
1 changed files with 10 additions and 7 deletions
|
@ -1702,12 +1702,6 @@ send_lost_event (GstRtpJitterBuffer * jitterbuffer, guint seqnum,
|
||||||
priv->num_late += lost_packets;
|
priv->num_late += lost_packets;
|
||||||
priv->discont = TRUE;
|
priv->discont = TRUE;
|
||||||
|
|
||||||
/* update our expected next packet but make sure the seqnum increases */
|
|
||||||
if (seqnum + lost_packets > priv->next_seqnum) {
|
|
||||||
priv->next_seqnum = (seqnum + lost_packets) & 0xffff;
|
|
||||||
priv->last_popped_seqnum = seqnum;
|
|
||||||
priv->last_out_time = timestamp;
|
|
||||||
}
|
|
||||||
if (priv->do_lost) {
|
if (priv->do_lost) {
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
|
|
||||||
|
@ -1722,6 +1716,12 @@ send_lost_event (GstRtpJitterBuffer * jitterbuffer, guint seqnum,
|
||||||
gst_pad_push_event (priv->srcpad, event);
|
gst_pad_push_event (priv->srcpad, event);
|
||||||
JBUF_LOCK (priv);
|
JBUF_LOCK (priv);
|
||||||
}
|
}
|
||||||
|
/* update our expected next packet but make sure the seqnum increases */
|
||||||
|
if (seqnum + lost_packets > priv->next_seqnum) {
|
||||||
|
priv->next_seqnum = (seqnum + lost_packets) & 0xffff;
|
||||||
|
priv->last_popped_seqnum = seqnum;
|
||||||
|
priv->last_out_time = timestamp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2369,10 +2369,13 @@ do_lost_timeout (GstRtpJitterBuffer * jitterbuffer, TimerData * timer,
|
||||||
|
|
||||||
/* remove timer now */
|
/* remove timer now */
|
||||||
remove_timer (jitterbuffer, timer);
|
remove_timer (jitterbuffer, timer);
|
||||||
JBUF_SIGNAL_EVENT (priv);
|
|
||||||
|
|
||||||
|
/* this releases the lock */
|
||||||
send_lost_event (jitterbuffer, seqnum, num, timestamp, duration, late);
|
send_lost_event (jitterbuffer, seqnum, num, timestamp, duration, late);
|
||||||
|
|
||||||
|
/* now we can let the pushing thread try again */
|
||||||
|
JBUF_SIGNAL_EVENT (priv);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue