diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2014-01-29 07:14:58 +0100 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2014-02-02 19:40:39 +0100 |
| commit | 57000b513bd54b9dba3b308b7734c88962b81ae3 (patch) | |
| tree | 925ae0106fd68f1b5cd77fd89aa48eaa7e35bf9b /apps | |
| parent | 60dea95cad710095477a2f5e35bd5692f79f76da (diff) | |
| download | rockbox-57000b513bd54b9dba3b308b7734c88962b81ae3.zip rockbox-57000b513bd54b9dba3b308b7734c88962b81ae3.tar.gz rockbox-57000b513bd54b9dba3b308b7734c88962b81ae3.tar.bz2 rockbox-57000b513bd54b9dba3b308b7734c88962b81ae3.tar.xz | |
talk: Make talk_voice_required() local to talk.c
Change-Id: I3a04760d550efab7f011a917597ef29c039b05bd
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/talk.c | 26 | ||||
| -rw-r--r-- | apps/talk.h | 3 | ||||
| -rw-r--r-- | apps/voice_thread.c | 6 |
3 files changed, 13 insertions, 22 deletions
diff --git a/apps/talk.c b/apps/talk.c index 2dcaf91..88d9afa 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -797,6 +797,16 @@ static void queue_clip(unsigned long clip_offset, long size, bool enqueue) return; } +#if CONFIG_CODEC == SWCODEC +/* return if a voice codec is required or not */ +static bool talk_voice_required(void) +{ + return (has_voicefile) /* Voice file is available */ + || (global_settings.talk_dir_clip) /* Thumbnail clips are required */ + || (global_settings.talk_file_clip); +} +#endif + /***************** Public implementation *****************/ void talk_init(void) @@ -877,9 +887,9 @@ void talk_init(void) #endif #if CONFIG_CODEC == SWCODEC - /* Safe to init voice playback engine now since we now know if talk is - required or not */ - voice_thread_init(); + /* Initialize the actual voice clip playback engine as well */ + if (talk_voice_required()) + voice_thread_init(); #endif out: @@ -887,16 +897,6 @@ out: filehandle = -1; } -#if CONFIG_CODEC == SWCODEC -/* return if a voice codec is required or not */ -bool talk_voice_required(void) -{ - return (has_voicefile) /* Voice file is available */ - || (global_settings.talk_dir_clip) /* Thumbnail clips are required */ - || (global_settings.talk_file_clip); -} -#endif - /* somebody else claims the mp3 buffer, e.g. for regular play/record */ void talk_buffer_set_policy(int policy) { diff --git a/apps/talk.h b/apps/talk.h index 28be718..4da3a61 100644 --- a/apps/talk.h +++ b/apps/talk.h @@ -96,9 +96,6 @@ extern const char* const dir_thumbnail_name; /* "_dirname.talk" */ extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */ void talk_init(void); -#if CONFIG_CODEC == SWCODEC -bool talk_voice_required(void); /* returns true if voice codec required */ -#endif int talk_get_bufsize(void); /* get the loaded voice file size */ size_t talkbuf_init(char* bufstart); bool is_voice_queued(void); /* Are there more voice clips to be spoken? */ diff --git a/apps/voice_thread.c b/apps/voice_thread.c index 3b6fe5b..72ecb37 100644 --- a/apps/voice_thread.c +++ b/apps/voice_thread.c @@ -526,12 +526,6 @@ void voice_thread_init(void) if (voice_thread_id != 0) return; /* Already did an init and succeeded at it */ - if (!talk_voice_required()) - { - logf("No voice required"); - return; - } - voice_buf_hid = core_alloc_ex("voice buf", sizeof (*voice_buf), &ops); if (voice_buf_hid <= 0) |