# HG changeset patch # User chainsaw # Date 1134761147 28800 # Node ID 5ca6e39394b50d1fa3ca0ffebf21c133c5d37b02 # Parent 8eab873f20a8d46ac65c65ea5fc68ea5dbaff12e [svn] GThreadify and fix includes. And although it compiles, let us not ship this. No playback at all. diff -r 8eab873f20a8 -r 5ca6e39394b5 Plugins/Input/timidity/src/Makefile.am --- a/Plugins/Input/timidity/src/Makefile.am Wed Dec 14 11:36:27 2005 -0800 +++ b/Plugins/Input/timidity/src/Makefile.am Fri Dec 16 11:25:47 2005 -0800 @@ -12,4 +12,4 @@ xmms-timidity.c \ xmms-timidity.h -INCLUDES = $(GTK_CFLAGS) -I$(top_srcdir) -I../libtimidity +INCLUDES = $(GTK_CFLAGS) -I$(top_builddir)/intl -I$(top_srcdir) -I../libtimidity diff -r 8eab873f20a8 -r 5ca6e39394b5 Plugins/Input/timidity/src/xmms-timidity.c --- a/Plugins/Input/timidity/src/xmms-timidity.c Wed Dec 14 11:36:27 2005 -0800 +++ b/Plugins/Input/timidity/src/xmms-timidity.c Fri Dec 16 11:25:47 2005 -0800 @@ -21,8 +21,9 @@ #include #endif -#include -#include +#include "libaudacious/util.h" +#include "libaudacious/configfile.h" +#include "libaudacious/titlestring.h" #include #include #include @@ -66,7 +67,7 @@ } xmmstimid_cfg; static gboolean xmmstimid_initialized = FALSE; -static pthread_t xmmstimid_decode_thread; +static GThread *xmmstimid_decode_thread; static gboolean xmmstimid_audio_error = FALSE; static MidSongOptions xmmstimid_opts; static MidSong *xmmstimid_song; @@ -267,7 +268,7 @@ xmmstimid_opts.buffer_size; buffer = g_malloc(buffer_size); - if (buffer == NULL) pthread_exit(NULL); + if (buffer == NULL) g_thread_exit(NULL); fmt = (xmmstimid_opts.format == MID_AUDIO_S16LSB) ? FMT_S16_LE : FMT_S8; @@ -300,7 +301,7 @@ g_free(buffer); - pthread_exit(NULL); + g_thread_exit(NULL); } static gchar *xmmstimid_get_title(gchar *filename) { @@ -387,8 +388,8 @@ xmmstimid_eof = FALSE; xmmstimid_seek_to = -1; - if (pthread_create(&xmmstimid_decode_thread, - NULL, xmmstimid_play_loop, NULL) != 0) { + xmmstimid_decode_thread = g_thread_create(xmmstimid_play_loop, NULL, TRUE, NULL); + if (xmmstimid_decode_thread == NULL) { mid_song_free(xmmstimid_song); xmmstimid_stop(); } @@ -397,7 +398,7 @@ void xmmstimid_stop(void) { if (xmmstimid_song != NULL && xmmstimid_going) { xmmstimid_going = FALSE; - pthread_join(xmmstimid_decode_thread, NULL); + g_thread_join(xmmstimid_decode_thread); xmmstimid_ip.output->close_audio(); mid_song_free(xmmstimid_song); xmmstimid_song = NULL;