Fix the logic from commit 3343bb45b6 that caused the end of the speech to be clipped.

This commit is contained in:
Reece H. Dunn
2016-01-03 20:44:27 +00:00
parent 59006f4762
commit a8eb65ee61
+5 -5
View File
@@ -203,17 +203,17 @@ espeak_ng_STATUS event_declare(espeak_EVENT *event)
return EINVAL;
espeak_ng_STATUS status;
if ((status = pthread_mutex_lock(&my_mutex)) != ENS_OK)
if ((status = pthread_mutex_lock(&my_mutex)) != ENS_OK) {
sem_post(&my_sem_start_is_required);
return status;
}
espeak_EVENT *a_event = event_copy(event);
if ((status = push(a_event)) != ENS_OK) {
event_delete(a_event);
pthread_mutex_unlock(&my_mutex);
return status;
}
status = pthread_mutex_lock(&my_mutex);
} else
status = pthread_mutex_unlock(&my_mutex);
sem_post(&my_sem_start_is_required);