diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index bc952c2131..fefa259d4f 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -2240,6 +2240,9 @@ rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer, prevactive = RTP_SOURCE_IS_ACTIVE (source); oldrate = source->bitrate; + if (created) + on_new_ssrc (sess, source); + /* let source process the packet */ result = rtp_source_process_rtp (source, &pinfo); @@ -2252,8 +2255,6 @@ rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer, if (oldrate != source->bitrate) sess->recalc_bandwidth = TRUE; - if (created) - on_new_ssrc (sess, source); if (source->validated) { gboolean created; diff --git a/tests/check/elements/rtpsession.c b/tests/check/elements/rtpsession.c index a00766fb23..60bd167975 100644 --- a/tests/check/elements/rtpsession.c +++ b/tests/check/elements/rtpsession.c @@ -1861,6 +1861,32 @@ GST_START_TEST (test_on_sending_nacks) GST_END_TEST; +static void +disable_probation_on_new_ssrc (GObject * session, GObject * source) +{ + g_object_set (source, "probation", 0, NULL); +} + +GST_START_TEST (test_disable_probation) +{ + SessionHarness *h = session_harness_new (); + + g_object_set (h->internal_session, "internal-ssrc", 0xDEADBEEF, NULL); + g_signal_connect (h->internal_session, "on-new-ssrc", + G_CALLBACK (disable_probation_on_new_ssrc), NULL); + + /* Receive a RTP buffer from the wire */ + fail_unless_equals_int (GST_FLOW_OK, + session_harness_recv_rtp (h, generate_test_buffer (0, 0x12345678))); + + /* When probation is disable, the packet should be produced immediatly */ + fail_unless_equals_int (1, gst_harness_buffers_in_queue (h->recv_rtp_h)); + + session_harness_free (h); +} + +GST_END_TEST; + static Suite * rtpsession_suite (void) { @@ -1890,6 +1916,7 @@ rtpsession_suite (void) tcase_add_test (tc_chain, test_change_sent_sdes); tcase_add_test (tc_chain, test_disable_sr_timestamp); tcase_add_test (tc_chain, test_on_sending_nacks); + tcase_add_test (tc_chain, test_disable_probation); return s; }