From 7a29d716bd8b58d5e1fbcef03e7a0f6c12fbfef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 6 Apr 2008 20:16:27 +0000 Subject: [PATCH] gst/: Work around missing bits of thread-safety on older GLibs some more to avoid assertions when starting up multipl... Original commit message from CVS: * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_class_init): * gst-libs/gst/audio/gstbaseaudiosrc.c: (gst_base_audio_src_class_init): * gst/playback/gstplayback.c: (plugin_init): * gst/volume/gstvolume.c: (plugin_init): Work around missing bits of thread-safety on older GLibs some more to avoid assertions when starting up multiple playbin objects concurrently (see #512382). --- ChangeLog | 12 ++++++++++++ gst-libs/gst/audio/gstbaseaudiosink.c | 1 + gst-libs/gst/audio/gstbaseaudiosrc.c | 1 + gst/playback/gstplayback.c | 8 ++++++++ gst/volume/gstvolume.c | 4 ++++ 5 files changed, 26 insertions(+) diff --git a/ChangeLog b/ChangeLog index a7367f67c3..8d5a3261c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-04-06 Tim-Philipp Müller + + * gst-libs/gst/audio/gstbaseaudiosink.c: + (gst_base_audio_sink_class_init): + * gst-libs/gst/audio/gstbaseaudiosrc.c: + (gst_base_audio_src_class_init): + * gst/playback/gstplayback.c: (plugin_init): + * gst/volume/gstvolume.c: (plugin_init): + Work around missing bits of thread-safety on older GLibs some + more to avoid assertions when starting up multiple playbin + objects concurrently (see #512382). + 2008-04-06 Tim-Philipp Müller * gst-libs/gst/pbutils/missing-plugins.c: (copy_and_clean_caps): diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index 91ab4928c2..512ad1649c 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -216,6 +216,7 @@ gst_base_audio_sink_class_init (GstBaseAudioSinkClass * klass) /* ref class from a thread-safe context to work around missing bit of * thread-safety in GObject */ g_type_class_ref (GST_TYPE_AUDIO_CLOCK); + g_type_class_ref (GST_TYPE_RING_BUFFER); } static void diff --git a/gst-libs/gst/audio/gstbaseaudiosrc.c b/gst-libs/gst/audio/gstbaseaudiosrc.c index a3b91655a2..8bc60404a9 100644 --- a/gst-libs/gst/audio/gstbaseaudiosrc.c +++ b/gst-libs/gst/audio/gstbaseaudiosrc.c @@ -175,6 +175,7 @@ gst_base_audio_src_class_init (GstBaseAudioSrcClass * klass) /* ref class from a thread-safe context to work around missing bit of * thread-safety in GObject */ g_type_class_ref (GST_TYPE_AUDIO_CLOCK); + g_type_class_ref (GST_TYPE_RING_BUFFER); } static void diff --git a/gst/playback/gstplayback.c b/gst/playback/gstplayback.c index d5e9a1a48e..88e686f8e6 100644 --- a/gst/playback/gstplayback.c +++ b/gst/playback/gstplayback.c @@ -27,6 +27,9 @@ #include #include +#include "gststreamselector.h" +#include "gststreaminfo.h" + gboolean gst_play_bin_plugin_init (GstPlugin * plugin); gboolean gst_play_bin2_plugin_init (GstPlugin * plugin); @@ -43,6 +46,11 @@ plugin_init (GstPlugin * plugin) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); #endif /* ENABLE_NLS */ + /* ref class from a thread-safe context to work around missing bit of + * thread-safety in GObject */ + g_type_class_ref (GST_TYPE_STREAM_INFO); + g_type_class_ref (GST_TYPE_STREAM_SELECTOR); + res = gst_play_bin_plugin_init (plugin); res &= gst_play_bin2_plugin_init (plugin); diff --git a/gst/volume/gstvolume.c b/gst/volume/gstvolume.c index 0ad23b1681..b5bceb4a5a 100644 --- a/gst/volume/gstvolume.c +++ b/gst/volume/gstvolume.c @@ -801,6 +801,10 @@ plugin_init (GstPlugin * plugin) GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "volume", 0, "Volume gain"); + /* ref class from a thread-safe context to work around missing bit of + * thread-safety in GObject */ + g_type_class_ref (GST_TYPE_MIXER_TRACK); + return gst_element_register (plugin, "volume", GST_RANK_NONE, GST_TYPE_VOLUME); }