Blob Blame History Raw
diff -Nur audacious-plugins-fedora-2.1-orig/src/sndfile/plugin.c audacious-plugins-fedora-2.1-sndfile/src/sndfile/plugin.c
--- audacious-plugins-fedora-2.1-orig/src/sndfile/plugin.c	2009-07-07 00:40:36.000000000 +0200
+++ audacious-plugins-fedora-2.1-sndfile/src/sndfile/plugin.c	2009-10-29 13:09:20.444864401 +0100
@@ -49,7 +49,6 @@
 static glong seek_time = -1;
 static volatile char pause_flag;
 
-static GThread *decode_thread;
 static GMutex *decode_mutex;
 static GCond *decode_cond;
 
@@ -395,17 +394,8 @@
         samples = sf_read_short (sndfile, buffer, BUFFER_SIZE);
 
         if (samples > 0 && playback->playing == TRUE) {
-            while ((playback->output->buffer_free () < samples) &&
-                   playback->playing == TRUE) {
-                g_get_current_time(&sleeptime);
-                g_time_val_add(&sleeptime, 500000);
-                g_mutex_lock(decode_mutex);
-                g_cond_timed_wait(decode_cond, decode_mutex, &sleeptime);
-                g_mutex_unlock(decode_mutex);
-
                 if (playback->playing == FALSE)
                     break;
-            }
 
             playback->pass_audio(playback, FMT_S16_NE, sfinfo.channels, 
                                  samples * sizeof(buffer[0]), buffer, &playback->playing);
@@ -482,9 +472,9 @@
 
     playback->playing = TRUE;
 
-    decode_thread = g_thread_self();
     playback->set_pb_ready(playback);
     play_loop(playback);
+    playback->playing = FALSE;
 }
 
 static void
@@ -496,18 +486,12 @@
 static void
 play_stop (InputPlayback *playback)
 {
-    if (decode_thread == NULL)
-        return;
-
     g_mutex_lock(decode_mutex);
     playback->playing = FALSE;
     g_mutex_unlock(decode_mutex);
     g_cond_signal(decode_cond);
 
-    g_thread_join (decode_thread);
-
     sndfile = NULL;
-    decode_thread = NULL;
     seek_time = -1;
 }