Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-03-12 06:43:39 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-03-12 06:43:39 (GMT)
commite622c1eda9e262dfa707d8444f241ebb9f23281e (patch)
treeca7684efe2ce3449b8f9c319af94030826bf4776
parent9ed6c0d2b443d16c8d7862e201305e266c1d3dec (diff)
Take into account the first position while catching marks
-rw-r--r--src/espeak.c25
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;