diff options
author | Alessandro Decina <alessandro.d@gmail.com> | 2015-11-25 14:51:40 +1100 |
---|---|---|
committer | Alessandro Decina <alessandro.d@gmail.com> | 2015-11-25 14:54:58 +1100 |
commit | dd4df554d5c2d4a61d09e7ec7ab5844d126474a9 (patch) | |
tree | 643929a041c3f7a50b59f94dde6d231c5428bc6a /gst/rtpmanager/rtpsession.c | |
parent | 2dbc9f86fce28f7f06205b6668d568e754b89ba9 (diff) |
rtpmanager: rtpsession: don't send empty RTCP packets
generate_rtcp can produce empty packets when reduced size RTCP is turned on.
Skip them since it doesn't make sense to push them and they cause errors with
elements that expect RTCP packets to contain data (like srtpenc).
Diffstat (limited to 'gst/rtpmanager/rtpsession.c')
-rw-r--r-- | gst/rtpmanager/rtpsession.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index 8865c0d43..b006a3eae 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -4026,7 +4026,7 @@ done: /* push out the RTCP packets */ while ((output = g_queue_pop_head (&data.output))) { - gboolean do_not_suppress; + gboolean do_not_suppress, empty_buffer; GstBuffer *buffer = output->buffer; RTPSource *source = output->source; @@ -4034,7 +4034,10 @@ done: g_signal_emit (sess, rtp_session_signals[SIGNAL_ON_SENDING_RTCP], 0, buffer, data.is_early, &do_not_suppress); - if (sess->callbacks.send_rtcp && (do_not_suppress || !data.may_suppress)) { + empty_buffer = gst_buffer_get_size (buffer) == 0; + + if (sess->callbacks.send_rtcp && + !empty_buffer && (do_not_suppress || !data.may_suppress)) { guint packet_size; packet_size = gst_buffer_get_size (buffer) + sess->header_len; @@ -4052,9 +4055,11 @@ done: RTP_SESSION_UNLOCK (sess); } else { GST_DEBUG ("freeing packet callback: %p" + " empty_buffer: %d, " " do_not_suppress: %d may_suppress: %d", sess->callbacks.send_rtcp, - do_not_suppress, data.may_suppress); - sess->stats.nacks_dropped += data.nacked_seqnums; + empty_buffer, do_not_suppress, data.may_suppress); + if (!empty_buffer) + sess->stats.nacks_dropped += data.nacked_seqnums; gst_buffer_unref (buffer); } g_object_unref (source); |