From 61bc228a7154499efeaa3f2442b8747c08cbfcfc Mon Sep 17 00:00:00 2001 From: Stian Selnes Date: Mon, 30 Jun 2014 15:43:58 +0200 Subject: [PATCH] rtpsession: sanity check RTT before ignoring PLI/FIR --- gst/rtpmanager/rtpsession.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index e3bf338cd6..3a2768b6a3 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -2575,6 +2575,11 @@ rtp_session_request_local_key_unit (RTPSession * sess, RTPSource * src, GstClockTime round_trip_in_ns = gst_util_uint64_scale (round_trip, GST_SECOND, 65536); + /* Sanity check to avoid always ignoring PLI/FIR if we receive RTCP + * packets with erroneous values resulting in crazy high RTT. */ + if (round_trip_in_ns > 5 * GST_SECOND) + round_trip_in_ns = GST_SECOND / 2; + if (current_time - sess->last_keyframe_request < 2 * round_trip_in_ns) { GST_DEBUG ("Ignoring %s request because one was send without one " "RTT (%" GST_TIME_FORMAT " < %" GST_TIME_FORMAT ")", -- 2.34.1