diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-08-27 09:34:46 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-08-27 09:55:52 +0200 |
commit | 454d75951e4438f83e9d491c9548e071e2e2f827 (patch) | |
tree | fdbc307c5eefea6aacb795a73abb89a866846f01 /gst/rtpmanager/gstrtpsession.c | |
parent | dd4af0d11ca5b00378ea2123002b85911d2f5a2c (diff) |
jitterbuffer: fix types of the retransmission event
Diffstat (limited to 'gst/rtpmanager/gstrtpsession.c')
-rw-r--r-- | gst/rtpmanager/gstrtpsession.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 6cb0d09b2..c9beff727 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -1504,7 +1504,7 @@ gst_rtp_session_event_recv_rtp_src (GstPad * pad, GstObject * parent, forward = FALSE; } else if (gst_structure_has_name (s, "GstRTPRetransmissionRequest")) { GstClockTime running_time; - guint seqnum, delay, deadline; + guint seqnum, delay, deadline, max_delay; if (!gst_structure_get_clock_time (s, "running-time", &running_time)) running_time = -1; @@ -1512,13 +1512,23 @@ gst_rtp_session_event_recv_rtp_src (GstPad * pad, GstObject * parent, ssrc = -1; if (!gst_structure_get_uint (s, "seqnum", &seqnum)) seqnum = -1; - if (!gst_structure_get_uint (s, "delay", &deadline)) - delay = -1; + if (!gst_structure_get_uint (s, "delay", &delay)) + delay = 0; if (!gst_structure_get_uint (s, "deadline", &deadline)) - deadline = -1; + deadline = 100; + + /* remaining time to receive the packet */ + max_delay = deadline; + if (max_delay > delay) + max_delay -= delay; + /* estimated RTT */ + if (max_delay > 40) + max_delay -= 40; + else + max_delay = 0; if (rtp_session_request_nack (rtpsession->priv->session, ssrc, seqnum, - (deadline - delay) * GST_MSECOND)) + max_delay * GST_MSECOND)) forward = FALSE; } break; |