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