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
This commit is contained in:
Nils Wallménius 2007-08-29 15:11:19 +00:00
parent 12c82bdb77
commit 441fa76a6d
3 changed files with 4 additions and 9 deletions

View file

@ -658,8 +658,7 @@ void audio_play(long offset)
#ifdef PLAYBACK_VOICE #ifdef PLAYBACK_VOICE
/* Truncate any existing voice output so we don't have spelling /* Truncate any existing voice output so we don't have spelling
* etc. over the first part of the played track */ * etc. over the first part of the played track */
LOGFQUEUE("mp3 > voice Q_VOICE_STOP"); do_shutup();
queue_post(&voice_queue, Q_VOICE_STOP, 1);
#endif #endif
/* Start playback */ /* Start playback */
@ -943,8 +942,7 @@ static void voice_stop(void)
if (!voice_codec_loaded) if (!voice_codec_loaded)
return; return;
LOGFQUEUE("mp3 > voice Q_VOICE_STOP"); do_shutup();
queue_post(&voice_queue, Q_VOICE_STOP, 0);
/* Loop until voice empties it's queue, stops and picks up on the new /* Loop until voice empties it's queue, stops and picks up on the new
track; the voice thread must be stopped and waiting for messages track; the voice thread must be stopped and waiting for messages

View file

@ -141,7 +141,6 @@ static int queue_clip(unsigned char* buf, long size, bool enqueue);
static int open_voicefile(void); static int open_voicefile(void);
static unsigned char* get_clip(long id, long* p_size); static unsigned char* get_clip(long id, long* p_size);
static int shutup(void); /* Interrupt voice, as when enqueue is false */ static int shutup(void); /* Interrupt voice, as when enqueue is false */
static int do_shutup(void); /* kill voice unconditionally */
/***************** Private implementation *****************/ /***************** Private implementation *****************/
@ -311,7 +310,7 @@ re_check:
} }
/* stop the playback and the pending clips */ /* stop the playback and the pending clips */
static int do_shutup(void) int do_shutup(void)
{ {
#if CONFIG_CODEC != SWCODEC #if CONFIG_CODEC != SWCODEC
unsigned char* pos; unsigned char* pos;

View file

@ -76,9 +76,7 @@ int talk_spell(const char* spell, bool enqueue); /* spell a string */
bool talk_menus_enabled(void); /* returns true if menus should be voiced */ bool talk_menus_enabled(void); /* returns true if menus should be voiced */
void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */ void talk_disable_menus(void); /* disable voice menus (temporarily, not persisted) */
void talk_enable_menus(void); /* re-enable voice menus */ void talk_enable_menus(void); /* re-enable voice menus */
int do_shutup(void); /* kill voice unconditionally */
/* This (otherwise invalid) ID signals the end of the array. */ /* This (otherwise invalid) ID signals the end of the array. */
#define TALK_FINAL_ID LANG_LAST_INDEX_IN_ARRAY #define TALK_FINAL_ID LANG_LAST_INDEX_IN_ARRAY