mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 13:18:52 +00:00
pulseaudiosink: Clean up refcounting in event probe
Makes sure we don't leak a refcount if the object is disposed before a NEWSEGMENT turns up.
This commit is contained in:
parent
21d3faa400
commit
f6f1605468
1 changed files with 3 additions and 3 deletions
|
@ -537,7 +537,6 @@ dbin2_event_probe (GstPad * pad, GstMiniObject * obj, gpointer data)
|
|||
if (GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT) {
|
||||
GST_DEBUG_OBJECT (pbin, "Got newsegment - dropping");
|
||||
gst_pad_remove_event_probe (pad, pbin->event_probe_id);
|
||||
gst_object_unref (pbin);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -596,8 +595,9 @@ gst_pulse_audio_sink_add_dbin2 (GstPulseAudioSink * pbin)
|
|||
|
||||
/* Trap the newsegment events that we feed the decodebin and discard them */
|
||||
sinkpad = gst_element_get_static_pad (GST_ELEMENT (pbin->psink), "sink");
|
||||
pbin->event_probe_id = gst_pad_add_event_probe (sinkpad,
|
||||
G_CALLBACK (dbin2_event_probe), gst_object_ref (pbin));
|
||||
pbin->event_probe_id = gst_pad_add_event_probe_full (sinkpad,
|
||||
G_CALLBACK (dbin2_event_probe), gst_object_ref (pbin),
|
||||
(GDestroyNotify) gst_object_unref);
|
||||
gst_object_unref (sinkpad);
|
||||
sinkpad = NULL;
|
||||
|
||||
|
|
Loading…
Reference in a new issue