diff options
author | Nils Wallménius <nils@rockbox.org> | 2007-08-29 15:11:19 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2007-08-29 15:11:19 +0000 |
commit | 441fa76a6d23128169ed6c3768f014808df88329 (patch) | |
tree | 8b39e11d68dad2e31777351b241c8ed83668c538 /apps | |
parent | 12c82bdb779d104cbff3a5e5058424357d5dadf8 (diff) | |
download | rockbox-441fa76a6d23128169ed6c3768f014808df88329.tar.gz rockbox-441fa76a6d23128169ed6c3768f014808df88329.zip |
Fix flushing of voice during playback, patch in FS#6239 by Stephane Doyon and Daniel Dalton
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14517 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playback.c | 6 | ||||
-rw-r--r-- | apps/talk.c | 3 | ||||
-rw-r--r-- | apps/talk.h | 4 |
3 files changed, 4 insertions, 9 deletions
diff --git a/apps/playback.c b/apps/playback.c index 13167e3ffe..b7d3b9987f 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -658,8 +658,7 @@ void audio_play(long offset) | |||
658 | #ifdef PLAYBACK_VOICE | 658 | #ifdef PLAYBACK_VOICE |
659 | /* Truncate any existing voice output so we don't have spelling | 659 | /* Truncate any existing voice output so we don't have spelling |
660 | * etc. over the first part of the played track */ | 660 | * etc. over the first part of the played track */ |
661 | LOGFQUEUE("mp3 > voice Q_VOICE_STOP"); | 661 | do_shutup(); |
662 | queue_post(&voice_queue, Q_VOICE_STOP, 1); | ||
663 | #endif | 662 | #endif |
664 | 663 | ||
665 | /* Start playback */ | 664 | /* Start playback */ |
@@ -943,8 +942,7 @@ static void voice_stop(void) | |||
943 | if (!voice_codec_loaded) | 942 | if (!voice_codec_loaded) |
944 | return; | 943 | return; |
945 | 944 | ||
946 | LOGFQUEUE("mp3 > voice Q_VOICE_STOP"); | 945 | do_shutup(); |
947 | queue_post(&voice_queue, Q_VOICE_STOP, 0); | ||
948 | 946 | ||
949 | /* Loop until voice empties it's queue, stops and picks up on the new | 947 | /* Loop until voice empties it's queue, stops and picks up on the new |
950 | track; the voice thread must be stopped and waiting for messages | 948 | track; the voice thread must be stopped and waiting for messages |
diff --git a/apps/talk.c b/apps/talk.c index 9e73f71084..b9d5bc2aa7 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -141,7 +141,6 @@ static int queue_clip(unsigned char* buf, long size, bool enqueue); | |||
141 | static int open_voicefile(void); | 141 | static int open_voicefile(void); |
142 | static unsigned char* get_clip(long id, long* p_size); | 142 | static unsigned char* get_clip(long id, long* p_size); |
143 | static int shutup(void); /* Interrupt voice, as when enqueue is false */ | 143 | static int shutup(void); /* Interrupt voice, as when enqueue is false */ |
144 | static int do_shutup(void); /* kill voice unconditionally */ | ||
145 | 144 | ||
146 | /***************** Private implementation *****************/ | 145 | /***************** Private implementation *****************/ |
147 | 146 | ||
@@ -311,7 +310,7 @@ re_check: | |||
311 | } | 310 | } |
312 | 311 | ||
313 | /* stop the playback and the pending clips */ | 312 | /* stop the playback and the pending clips */ |
314 | static int do_shutup(void) | 313 | int do_shutup(void) |
315 | { | 314 | { |
316 | #if CONFIG_CODEC != SWCODEC | 315 | #if CONFIG_CODEC != SWCODEC |
317 | unsigned char* pos; | 316 | unsigned char* pos; |
diff --git a/apps/talk.h b/apps/talk.h index b016acba59..75ab6fca7e 100644 --- a/apps/talk.h +++ b/apps/talk.h | |||
@@ -76,9 +76,7 @@ int talk_spell(const char* spell, bool enqueue); /* spell a string */ | |||
76 | bool talk_menus_enabled(void); /* returns true if menus should be voiced */ | 76 | bool talk_menus_enabled(void); /* returns true if menus should be voiced */ |
77 | void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */ | 77 | void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */ |
78 | void talk_enable_menus(void); /* re-enable voice menus */ | 78 | void talk_enable_menus(void); /* re-enable voice menus */ |
79 | 79 | int do_shutup(void); /* kill voice unconditionally */ | |
80 | |||
81 | |||
82 | 80 | ||
83 | /* This (otherwise invalid) ID signals the end of the array. */ | 81 | /* This (otherwise invalid) ID signals the end of the array. */ |
84 | #define TALK_FINAL_ID LANG_LAST_INDEX_IN_ARRAY | 82 | #define TALK_FINAL_ID LANG_LAST_INDEX_IN_ARRAY |