summaryrefslogtreecommitdiff
path: root/gst-libs/gst/audio/gstaudiosrc.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2011-12-04 16:43:38 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2011-12-04 17:16:30 +0000
commit0d98aa25b8a163625281b0b1d7f05dd0ed345218 (patch)
tree287d1f541ca876cc25a6a090b3713d8de4cae88b /gst-libs/gst/audio/gstaudiosrc.c
parent6098442bd0b2eb1e19c595aace0911af44b6a439 (diff)
Work around deprecated thread API in glib master
Add private replacements for deprecated functions such as g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly to avoid the deprecation warnings. We'll change these over to the new API once we depend on glib >= 2.32. Replace g_thread_create() with g_thread_try_new().
Diffstat (limited to 'gst-libs/gst/audio/gstaudiosrc.c')
-rw-r--r--gst-libs/gst/audio/gstaudiosrc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/gstaudiosrc.c b/gst-libs/gst/audio/gstaudiosrc.c
index d7a6b547d..004153e6c 100644
--- a/gst-libs/gst/audio/gstaudiosrc.c
+++ b/gst-libs/gst/audio/gstaudiosrc.c
@@ -71,6 +71,8 @@
#include "gstaudiosrc.h"
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (gst_audio_src_debug);
#define GST_CAT_DEFAULT gst_audio_src_debug
@@ -382,9 +384,16 @@ gst_audioringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec)
abuf = GST_AUDIORING_BUFFER (buf);
abuf->running = TRUE;
+ /* FIXME: handle thread creation failure */
+#if !GLIB_CHECK_VERSION (2, 31, 0)
src->thread =
g_thread_create ((GThreadFunc) audioringbuffer_thread_func, buf, TRUE,
NULL);
+#else
+ src->thread = g_thread_try_new ("audiosrc-ringbuffer",
+ (GThreadFunc) audioringbuffer_thread_func, buf, NULL);
+#endif
+
GST_AUDIORING_BUFFER_WAIT (buf);
return result;