summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro G. Castro <alex@igalia.com>2016-10-20 13:14:13 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-11-01 20:17:20 +0200
commit6e7816c589abd3f04eafa04694cc6ccb8943f7a3 (patch)
treec5ae2b46a333ebec1d14a346de034cd5a822b1eb
parenteeea2a7fe88a17b15318d5b6ae6e190b2f777030 (diff)
rtpbin: avoid generating errors when rtcp messages are empty and check the queue is not empty
Add a check to verify all the output buffers were empty for the session in a timout and log an error. https://bugzilla.gnome.org/show_bug.cgi?id=773269
-rw-r--r--gst/rtpmanager/rtpsession.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index aa8b40b4f..7db89e01c 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -3968,6 +3968,7 @@ rtp_session_on_timeout (RTPSession * sess, GstClockTime current_time,
ReportData data = { GST_RTCP_BUFFER_INIT };
GHashTable *table_copy;
ReportOutput *output;
+ gboolean all_empty = FALSE;
g_return_val_if_fail (RTP_IS_SESSION (sess), GST_FLOW_ERROR);
@@ -4031,6 +4032,9 @@ rtp_session_on_timeout (RTPSession * sess, GstClockTime current_time,
if (!is_rtcp_time (sess, current_time, &data))
goto done;
+ /* check if all the buffers are empty afer generation */
+ all_empty = TRUE;
+
GST_DEBUG
("doing RTCP generation %u for %u sources, early %d, may suppress %d",
sess->generation, data.num_to_report, data.is_early, data.may_suppress);
@@ -4081,8 +4085,8 @@ done:
empty_buffer = gst_buffer_get_size (buffer) == 0;
- if (empty_buffer)
- GST_ERROR ("rtpsession: Trying to send an empty RTCP packet");
+ if (!empty_buffer)
+ all_empty = FALSE;
if (sess->callbacks.send_rtcp &&
!empty_buffer && (do_not_suppress || !data.may_suppress)) {
@@ -4116,6 +4120,10 @@ done:
g_object_unref (source);
g_slice_free (ReportOutput, output);
}
+
+ if (all_empty)
+ GST_ERROR ("generated empty RTCP messages for all the sources");
+
return result;
}