[1.46.10]

Add --version command-line option.

Allow hexadecimal numbers for UTF-8 bytes in rules in *_rules files.

wave_pulse.cpp, ensure wave_close is not called again while waiting.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@278 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2011-12-21 15:43:20 +00:00
parent 0617cc4750
commit 5ac192df81
35 changed files with 2347 additions and 1710 deletions
+23 -10
View File
@@ -745,19 +745,32 @@ size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSiz
int wave_close(void* theHandler)
{
SHOW_TIME("wave_close > ENTER");
static int aStopStreamCount = 0;
int a_status = pthread_mutex_lock(&pulse_mutex);
if (a_status) {
SHOW("Error: pulse_mutex lock=%d (%s)\n", a_status, __FUNCTION__);
return PULSE_ERROR;
}
drain();
// Avoid race condition by making sure this function only
// gets called once at a time
aStopStreamCount++;
if (aStopStreamCount != 1)
{
SHOW_TIME("wave_close > LEAVE (stopStreamCount)");
return 0;
}
pthread_mutex_unlock(&pulse_mutex);
SHOW_TIME("wave_close (ret)");
int a_status = pthread_mutex_lock(&pulse_mutex);
if (a_status)
{
SHOW("Error: pulse_mutex lock=%d (%s)\n", a_status, __FUNCTION__);
aStopStreamCount = 0; // last action
return PULSE_ERROR;
}
return PULSE_OK;
drain();
pthread_mutex_unlock(&pulse_mutex);
SHOW_TIME("wave_close (ret)");
aStopStreamCount = 0; // last action
return PULSE_OK;
}
//>