aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlayerThread.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-04-17 01:49:43 +0200
committerMax Kellermann <max@duempel.org>2013-04-17 01:49:43 +0200
commita4a13a382525527afeecd18f97e948bd6d0de64c (patch)
tree19af72f5bfb5dc9dae8e82e7ff3c9d99b2c88335 /src/PlayerThread.cxx
parenta28df6123fef2047ec631d13c91156def6f7ab83 (diff)
downloadmpd-a4a13a382525527afeecd18f97e948bd6d0de64c.tar.gz
mpd-a4a13a382525527afeecd18f97e948bd6d0de64c.tar.xz
mpd-a4a13a382525527afeecd18f97e948bd6d0de64c.zip
use g_thread_new() if GLib is recent enough
Fixes deprecation warnings.
Diffstat (limited to 'src/PlayerThread.cxx')
-rw-r--r--src/PlayerThread.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx
index 2d8e6caaf..ccf16bb39 100644
--- a/src/PlayerThread.cxx
+++ b/src/PlayerThread.cxx
@@ -1202,8 +1202,12 @@ player_create(struct player_control *pc)
{
assert(pc->thread == NULL);
+#if GLIB_CHECK_VERSION(2,32,0)
+ pc->thread = g_thread_new("player", player_task, pc);
+#else
GError *e = NULL;
pc->thread = g_thread_create(player_task, pc, true, &e);
if (pc->thread == NULL)
MPD_ERROR("Failed to spawn player task: %s", e->message);
+#endif
}