diff options
Diffstat (limited to 'src/espeak.c')
-rw-r--r-- | src/espeak.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/espeak.c b/src/espeak.c index 87e773d..d0942d1 100644 --- a/src/espeak.c +++ b/src/espeak.c @@ -457,20 +457,19 @@ synth_cb(short *data, int numsamples, espeak_EVENT *events) if (i->type == espeakEVENT_MARK) { // suppress failed text_position values - if (spin->last_mark) + const gchar *eom = strstr(self->text + + spin->last_mark, "/>"); + if (eom) { - const gchar *eom = strstr(self->text + - spin->last_mark, "/>"); - if (eom) - { - int pos = eom - self->text + 2; - - if (i->text_position <= spin->last_mark || - pos > i->text_position) - i->text_position = pos; - } - else if (i->text_position <= spin->last_mark) - i->text_position = spin->last_mark; + int pos = eom - self->text + 2; + + if (i->text_position <= spin->last_mark || + pos > i->text_position) + i->text_position = pos; + } + else if (i->text_position <= spin->last_mark) + { + i->text_position = spin->last_mark; } spin->last_mark = i->text_position; |