From: Olivier CrĂȘte Date: Tue, 4 Jul 2017 16:24:41 +0000 (-0400) Subject: rtpsession: Only send EOS if all sources have been marked bye X-Git-Tag: 1.19.3~509^2~2000 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e7e52caa0c0d8e64735c1939bfc070a1148c942;p=platform%2Fupstream%2Fgstreamer.git rtpsession: Only send EOS if all sources have been marked bye Now that multiple sender RTPSource can share the same RTPSession, we must not send an EOS unless they're all marked bye. --- diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index 089aef7..612aa84 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -3950,6 +3950,21 @@ update_generation (const gchar * key, RTPSource * source, ReportData * data) } } +static gboolean +rtp_session_are_all_sources_bye (RTPSession * sess) +{ + GHashTableIter iter; + RTPSource *src; + + g_hash_table_iter_init (&iter, sess->ssrcs[sess->mask_idx]); + while (g_hash_table_iter_next (&iter, NULL, (gpointer *) & src)) { + if (!src->marked_bye) + return FALSE; + } + + return TRUE; +} + /** * rtp_session_on_timeout: * @sess: an #RTPSession @@ -4106,8 +4121,8 @@ done: GST_DEBUG ("%p, sending RTCP packet, avg size %u, %u", &sess->stats, sess->stats.avg_rtcp_packet_size, packet_size); result = - sess->callbacks.send_rtcp (sess, source, buffer, output->is_bye, - sess->send_rtcp_user_data); + sess->callbacks.send_rtcp (sess, source, buffer, + rtp_session_are_all_sources_bye (sess), sess->send_rtcp_user_data); RTP_SESSION_LOCK (sess); sess->stats.nacks_sent += data.nacked_seqnums;