From a4a13a382525527afeecd18f97e948bd6d0de64c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Apr 2013 01:49:43 +0200 Subject: use g_thread_new() if GLib is recent enough Fixes deprecation warnings. --- src/OutputThread.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/OutputThread.cxx') diff --git a/src/OutputThread.cxx b/src/OutputThread.cxx index 734c5783c..d072b50cd 100644 --- a/src/OutputThread.cxx +++ b/src/OutputThread.cxx @@ -673,10 +673,13 @@ static gpointer audio_output_task(gpointer arg) void audio_output_thread_start(struct audio_output *ao) { - GError *e = NULL; - assert(ao->command == AO_COMMAND_NONE); +#if GLIB_CHECK_VERSION(2,32,0) + ao->thread = g_thread_new("output", audio_output_task, ao); +#else + GError *e = nullptr; if (!(ao->thread = g_thread_create(audio_output_task, ao, true, &e))) MPD_ERROR("Failed to spawn output task: %s\n", e->message); +#endif } -- cgit v1.2.3