#include <vorbis/vorbisfile.h>
#include <libmodplug/modplug.h>
-#define BUFFSIZE 4096
+//#define BUFFSIZE 4096
+#define BUFFSIZE 512
#define SAMPLERATE 44100
#define MAX(x,y) ((x)>(y)) ? (x) : (y)
#define MIN(x,y) ((x)<(y)) ? (x) : (y)
static sem_t audio_full;
static sem_t audio_empty;
-int bleep_playing = 0;
+bool bleep_playing = FALSE;
+bool bleep_stop = FALSE;
float *musicbuffer;
void os_stop_sample (int number)
{
+ if (bleep_playing) {
+ bleep_stop = TRUE;
+ }
return;
}/* os_stop_sample */
bleep_playing = TRUE;
while (toread > 0) {
+ if (bleep_stop) break;
+
sem_wait(&audio_empty);
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
sem_post(&audio_full);
}
+ bleep_stop = FALSE;
bleep_playing = FALSE;
fseek(myeffect.fp, filestart, SEEK_SET);