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.
This commit is contained in:
William Hubbs 2009-07-01 13:01:41 -05:00
commit cc7e77eb9d
2 changed files with 1 additions and 1 deletions

View file

@ -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))

View file

@ -128,6 +128,7 @@ static espeak_ERROR stop_speech(void)
{
espeak_ERROR rc;
stop_audio();
rc = espeak_Cancel();
start_audio();
return rc;