From: Tim-Philipp Müller Date: Mon, 15 Jun 2009 14:51:32 +0000 (+0100) Subject: pulsesink: ref custom ring buffer class and type in class_init X-Git-Tag: RELEASE-0.10.16~469 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dea67f3d96595b9d05875952c98d37f65254ff35;p=platform%2Fupstream%2Fgst-plugins-good.git pulsesink: ref custom ring buffer class and type in class_init Hack around thread-safety issues in GObject and our racy _get_type() functions (we could easily fix the _get_type() functions, but we still need to hack around the GObject class races until we require a newer GLib version, I think). --- diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c index cc9902c..d18c523 100644 --- a/ext/pulse/pulsesink.c +++ b/ext/pulse/pulsesink.c @@ -183,6 +183,10 @@ gst_pulseringbuffer_class_init (GstPulseRingBufferClass * klass) gstringbuffer_class->stop = GST_DEBUG_FUNCPTR (gst_pulseringbuffer_stop); gstringbuffer_class->commit = GST_DEBUG_FUNCPTR (gst_pulseringbuffer_commit); + + /* ref class from a thread-safe context to work around missing bit of + * thread-safety in GObject */ + g_type_class_ref (GST_TYPE_PULSERING_BUFFER); } static void