From 8637216502792412e4af7e7680939128aa0f9093 Mon Sep 17 00:00:00 2001 From: Frederik Vestre Date: Wed, 13 Jan 2021 14:33:50 +0100 Subject: [PATCH] nice: Ref pad while sending signal, should fix #21516 --- gst/gstnicesink.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gst/gstnicesink.c b/gst/gstnicesink.c index c2c7d345..233e812d 100644 --- a/gst/gstnicesink.c +++ b/gst/gstnicesink.c @@ -201,13 +201,16 @@ gst_nice_sink_on_overflow (GstNiceSink * sink, if (stream_id == sink->stream_id && component_id == sink->component_id) { GST_DEBUG_OBJECT (sink, "Sink overflow for stream %d, component %d", stream_id, component_id); + GstPad * sinkpad = GST_BASE_SINK_PAD (sink); + gst_object_ref(sinkpad); #if GST_CHECK_VERSION (1,0,0) - gst_pad_push_event (GST_BASE_SINK_PAD (sink), + gst_pad_push_event (sinkpad, gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, gst_structure_new_empty ("PexQosOverflow"))); #else - gst_pad_push_event (GST_BASE_SINK_PAD (sink), + gst_pad_push_event (sinkpad, gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, gst_structure_new_empty ("PexQosOverflow"))); #endif + gst_object_unref(sinkpad); } } @@ -219,14 +222,16 @@ gst_nice_sink_on_writable (GstNiceSink * sink, if (stream_id == sink->stream_id && component_id == sink->component_id) { GST_DEBUG_OBJECT (sink, "Sink underflow for stream %d, component %d", stream_id, component_id); - + GstPad * sinkpad = GST_BASE_SINK_PAD (sink); + gst_object_ref(sinkpad); #if GST_CHECK_VERSION (1,0,0) - gst_pad_push_event (GST_BASE_SINK_PAD (sink), + gst_pad_push_event (sinkpad, gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, gst_structure_new_empty ("PexQosUnderflow"))); #else - gst_pad_push_event (GST_BASE_SINK_PAD (sink), + gst_pad_push_event (sinkpad, gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, gst_structure_new_empty ("PexQosUnderflow"))); #endif + gst_object_unref(sinkpad); } }