# HG changeset patch # User chainsaw # Date 1131917583 28800 # Node ID 2626212fdad4aa8e3e03c3ea388b5faba43b4d89 # Parent 7b98cea0bb49749b8338fc97d539204767940bab [svn] GThreadify this input plugin. diff -r 7b98cea0bb49 -r 2626212fdad4 Plugins/Input/flac/configure.c --- a/Plugins/Input/flac/configure.c Sun Nov 13 13:27:38 2005 -0800 +++ b/Plugins/Input/flac/configure.c Sun Nov 13 13:33:03 2005 -0800 @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff -r 7b98cea0bb49 -r 2626212fdad4 Plugins/Input/flac/http.c --- a/Plugins/Input/flac/http.c Sun Nov 13 13:27:38 2005 -0800 +++ b/Plugins/Input/flac/http.c Sun Nov 13 13:33:03 2005 -0800 @@ -30,8 +30,6 @@ #include #include -#include - #include #include @@ -66,7 +64,7 @@ static guint64 buffer_read = 0; static gchar *buffer; static guint64 offset; -static pthread_t thread; +static GThread *thread; static GtkWidget *error_dialog = NULL; static FILE *output_file = NULL; @@ -187,7 +185,7 @@ { going = FALSE; - pthread_join(thread, NULL); + g_thread_join(thread); g_free(icy_name); icy_name = NULL; } @@ -699,7 +697,7 @@ g_free(buffer); g_free(url); - pthread_exit(NULL); + g_thread_exit(NULL); return NULL; /* avoid compiler warning */ } @@ -721,7 +719,7 @@ buffer = g_malloc(buffer_length); offset = _offset; - pthread_create(&thread, NULL, http_buffer_loop, url); + thread = g_thread_create((GThreadFunc)http_buffer_loop, url, TRUE, NULL); return 0; } diff -r 7b98cea0bb49 -r 2626212fdad4 Plugins/Input/flac/plugin.c --- a/Plugins/Input/flac/plugin.c Sun Nov 13 13:27:38 2005 -0800 +++ b/Plugins/Input/flac/plugin.c Sun Nov 13 13:33:03 2005 -0800 @@ -16,7 +16,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -166,7 +165,7 @@ static void *decoder_ = 0; static file_info_struct file_info_; -static pthread_t decode_thread_; +static GThread *decode_thread_; static FLAC__bool audio_error_ = false; static FLAC__bool is_big_endian_host_; @@ -368,7 +367,7 @@ file_info_.seek_to_in_sec = -1; file_info_.play_thread_open = true; - pthread_create(&decode_thread_, NULL, play_loop_, NULL); + decode_thread_ = g_thread_create((GThreadFunc)play_loop_, NULL, TRUE, NULL); } void FLAC_XMMS__stop() @@ -377,7 +376,7 @@ file_info_.is_playing = false; if(file_info_.play_thread_open) { file_info_.play_thread_open = false; - pthread_join(decode_thread_, NULL); + g_thread_join(decode_thread_); } flac_ip.output->close_audio(); decoder_func_table_ -> safe_decoder_finish (decoder_); @@ -545,7 +544,7 @@ g_free(file_info_.title); - pthread_exit(NULL); + g_thread_exit(NULL); return 0; /* to silence the compiler warning about not returning a value */ }