Mercurial > hg > xmms-sid
diff src/xmms-sid.c @ 532:bc548249464a
Audacious glue.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 20 Feb 2007 22:03:01 +0000 |
parents | fa95d942f226 |
children | d609d0ece252 |
line wrap: on
line diff
--- a/src/xmms-sid.c Tue Feb 20 20:48:01 2007 +0000 +++ b/src/xmms-sid.c Tue Feb 20 22:03:01 2007 +0000 @@ -90,7 +90,7 @@ */ t_xs_status xs_status; XS_MUTEX(xs_status); -static pthread_t xs_decode_thread; +static XS_THREAD_T xs_decode_thread; static GtkWidget *xs_subctrl = NULL; static GtkObject *xs_subctrl_adj = NULL; @@ -558,7 +558,7 @@ /* Exit the playing thread */ XSDEBUG("exiting thread, bye.\n"); - pthread_exit(NULL); + XS_THREAD_EXIT(NULL); } @@ -593,7 +593,13 @@ xs_status.currSong = xs_status.tuneInfo->startTune; /* Start the playing thread! */ - if (pthread_create(&xs_decode_thread, NULL, xs_playthread, NULL) < 0) { +#ifdef AUDACIOUS_PLUGIN + xs_decode_thread = g_thread_create((GThreadFunc) xs_playthread, NULL, TRUE, NULL); + if (xs_decode_thread == NULL) +#else + if (pthread_create(&xs_decode_thread, NULL, xs_playthread, NULL) < 0) +#endif + { xs_error(_("Couldn't create playing thread!\n")); xs_tuneinfo_free(xs_status.tuneInfo); xs_status.tuneInfo = NULL; @@ -631,7 +637,7 @@ XSDEBUG("stopping...\n"); xs_status.isPlaying = FALSE; XS_MUTEX_UNLOCK(xs_status); - pthread_join(xs_decode_thread, NULL); + XS_THREAD_JOIN(xs_decode_thread); } else { XS_MUTEX_UNLOCK(xs_status); }