summaryrefslogtreecommitdiffstats
path: root/sys/osxaudio
diff options
context:
space:
mode:
Diffstat (limited to 'sys/osxaudio')
-rw-r--r--sys/osxaudio/gstosxaudiosink.c3
-rw-r--r--sys/osxaudio/gstosxaudiosrc.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/sys/osxaudio/gstosxaudiosink.c b/sys/osxaudio/gstosxaudiosink.c
index 2f4e27bc..433bd4d1 100644
--- a/sys/osxaudio/gstosxaudiosink.c
+++ b/sys/osxaudio/gstosxaudiosink.c
@@ -168,10 +168,12 @@ gst_osxaudiosink_chain (GstPad * pad, GstData * _data)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
gst_pad_event_default (pad, event);
+ gst_object_unref (osxaudiosink);
return;
case GST_EVENT_DISCONTINUOUS:
/* pass-through */
default:
+ gst_object_unref (osxaudiosink);
gst_pad_event_default (pad, event);
return;
}
@@ -189,6 +191,7 @@ gst_osxaudiosink_chain (GstPad * pad, GstData * _data)
write_buffer (GST_OSXAUDIOELEMENT (osxaudiosink), data, to_write);
}
gst_buffer_unref (buf);
+ gst_object_unref (osxaudiosink);
}
static GstStateChangeReturn
diff --git a/sys/osxaudio/gstosxaudiosrc.c b/sys/osxaudio/gstosxaudiosrc.c
index 94877ef5..6d0331ca 100644
--- a/sys/osxaudio/gstosxaudiosrc.c
+++ b/sys/osxaudio/gstosxaudiosrc.c
@@ -159,11 +159,13 @@ gst_osxaudiosrc_get (GstPad * pad)
if (readbytes < 0) {
gst_buffer_unref (buf);
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM);
+ gst_object_unref (src);
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
}
if (readbytes == 0) {
gst_buffer_unref (buf);
+ gst_object_unref (src);
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
}
@@ -174,6 +176,8 @@ gst_osxaudiosrc_get (GstPad * pad)
GST_DEBUG ("pushed buffer from soundcard of %ld bytes", readbytes);
+ gst_object_unref (src);
+
return GST_DATA (buf);
}