From e622c1eda9e262dfa707d8444f241ebb9f23281e Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 12 Mar 2009 06:43:39 +0000 Subject: Take into account the first position while catching marks --- 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; -- cgit v0.9.1