|
|
7669a1b |
diff -Nur audacious-plugins-1.5.1-sndfile-cleanup/src/sndfile/plugin.c audacious-plugins-1.5.1-sndfile-playfix/src/sndfile/plugin.c
|
|
|
7669a1b |
--- audacious-plugins-1.5.1-sndfile-cleanup/src/sndfile/plugin.c 2009-10-28 14:45:17.432796535 +0100
|
|
|
7669a1b |
+++ audacious-plugins-1.5.1-sndfile-playfix/src/sndfile/plugin.c 2009-10-28 14:43:21.000000000 +0100
|
|
|
7669a1b |
@@ -49,7 +49,6 @@
|
|
|
7669a1b |
static glong seek_time = -1;
|
|
|
7669a1b |
static volatile char pause_flag;
|
|
|
7669a1b |
|
|
|
7669a1b |
-static GThread *decode_thread;
|
|
|
7669a1b |
static GMutex *decode_mutex;
|
|
|
7669a1b |
static GCond *decode_cond;
|
|
|
7669a1b |
|
|
|
7669a1b |
@@ -395,17 +394,8 @@
|
|
|
7669a1b |
samples = sf_read_short (sndfile, buffer, BUFFER_SIZE);
|
|
|
7669a1b |
|
|
|
7669a1b |
if (samples > 0 && playback->playing == TRUE) {
|
|
|
7669a1b |
- while ((playback->output->buffer_free () < samples) &&
|
|
|
7669a1b |
- playback->playing == TRUE) {
|
|
|
7669a1b |
- g_get_current_time(&sleeptime);
|
|
|
7669a1b |
- g_time_val_add(&sleeptime, 500000);
|
|
|
7669a1b |
- g_mutex_lock(decode_mutex);
|
|
|
7669a1b |
- g_cond_timed_wait(decode_cond, decode_mutex, &sleeptime);
|
|
|
7669a1b |
- g_mutex_unlock(decode_mutex);
|
|
|
7669a1b |
-
|
|
|
7669a1b |
if (playback->playing == FALSE)
|
|
|
7669a1b |
break;
|
|
|
7669a1b |
- }
|
|
|
7669a1b |
|
|
|
7669a1b |
playback->pass_audio(playback, FMT_S16_NE, sfinfo.channels,
|
|
|
7669a1b |
samples * sizeof(buffer[0]), buffer, &playback->playing);
|
|
|
7669a1b |
@@ -483,9 +473,9 @@
|
|
|
7669a1b |
|
|
|
7669a1b |
playback->playing = TRUE;
|
|
|
7669a1b |
|
|
|
7669a1b |
- decode_thread = g_thread_self();
|
|
|
7669a1b |
playback->set_pb_ready(playback);
|
|
|
7669a1b |
play_loop(playback);
|
|
|
7669a1b |
+ playback->playing = FALSE;
|
|
|
7669a1b |
}
|
|
|
7669a1b |
|
|
|
7669a1b |
static void
|
|
|
7669a1b |
@@ -497,18 +487,12 @@
|
|
|
7669a1b |
static void
|
|
|
7669a1b |
play_stop (InputPlayback *playback)
|
|
|
7669a1b |
{
|
|
|
7669a1b |
- if (decode_thread == NULL)
|
|
|
7669a1b |
- return;
|
|
|
7669a1b |
-
|
|
|
7669a1b |
g_mutex_lock(decode_mutex);
|
|
|
7669a1b |
playback->playing = FALSE;
|
|
|
7669a1b |
g_mutex_unlock(decode_mutex);
|
|
|
7669a1b |
g_cond_signal(decode_cond);
|
|
|
7669a1b |
|
|
|
7669a1b |
- g_thread_join (decode_thread);
|
|
|
7669a1b |
-
|
|
|
7669a1b |
sndfile = NULL;
|
|
|
7669a1b |
- decode_thread = NULL;
|
|
|
7669a1b |
seek_time = -1;
|
|
|
7669a1b |
}
|
|
|
7669a1b |
|