From cc7e77eb9db904f27b9de12f4b25b17c2f6d5b02 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Wed, 1 Jul 2009 13:01:41 -0500 Subject: [PATCH] move stop_audio call to synth thread Since there is no reason currently for the softsynth thread to do this, it makes better sense to have the synth thread control all interaction with espeak. --- softsynth.c | 1 - synth.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/softsynth.c b/softsynth.c index 2c19023..96696a3 100644 --- a/softsynth.c +++ b/softsynth.c @@ -181,7 +181,6 @@ static void process_buffer(struct synth_t *s, char *buf, ssize_t length) static void request_espeak_stop(void) { pthread_mutex_lock(&queue_guard); - stop_audio(); runner_must_stop = 1; pthread_cond_signal(&runner_awake); /* Wake runner, if necessary. */ while(should_run && (runner_must_stop == 1)) diff --git a/synth.c b/synth.c index 6b4589a..d363d23 100644 --- a/synth.c +++ b/synth.c @@ -128,6 +128,7 @@ static espeak_ERROR stop_speech(void) { espeak_ERROR rc; + stop_audio(); rc = espeak_Cancel(); start_audio(); return rc;