From dad739981bfe18421cb8ede2e0881d23199f80cc Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Wed, 5 Apr 2017 13:52:06 +0200 Subject: [PATCH] rtp: stop the transmitter before unlinking its sink (case 2) This patch prevents the nice source to fail, when receiving data after its sink has been unlinked. It happens while destroying a farstream stream. https://bugs.freedesktop.org/show_bug.cgi?id=100565 --- transmitters/nice/fs-nice-transmitter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmitters/nice/fs-nice-transmitter.c b/transmitters/nice/fs-nice-transmitter.c index 4154537..04f0f40 100644 --- a/transmitters/nice/fs-nice-transmitter.c +++ b/transmitters/nice/fs-nice-transmitter.c @@ -754,12 +754,12 @@ fs_nice_transmitter_free_gst_stream (FsNiceTransmitter *self, if (ns->nicesrcs[c]) { GstStateChangeReturn ret; - if (!gst_bin_remove (GST_BIN (self->priv->gst_src), ns->nicesrcs[c])) - GST_ERROR ("Could not remove nicesrc element from transmitter source"); ret = gst_element_set_state (ns->nicesrcs[c], GST_STATE_NULL); if (ret != GST_STATE_CHANGE_SUCCESS) GST_ERROR ("Error changing state of nicesrc: %s", gst_element_state_change_return_get_name (ret)); + if (!gst_bin_remove (GST_BIN (self->priv->gst_src), ns->nicesrcs[c])) + GST_ERROR ("Could not remove nicesrc element from transmitter source"); gst_object_unref (ns->nicesrcs[c]); } -- 2.9.3