forked from len0rd/rockbox
Fix FS#12241. Voice stopped working after audio_get_buffer() calls.
Since r30308 the talk buffer was set to NULL if e.g. a plugin called audio_get_buffer() to steal the talk buffer. Since there's no audio_release_buffer() kind of function the talk buffer was never set back again. When trying to talk try to get the audio buffer with audio_get_buffer() as well, which works until the audio buffer gets properly reinitialized. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30840 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d3c21023e0
commit
5d5177931e
1 changed files with 6 additions and 1 deletions
|
|
@ -778,6 +778,7 @@ void talk_buffer_steal(void)
|
|||
int talk_id(int32_t id, bool enqueue)
|
||||
{
|
||||
long clipsize;
|
||||
size_t temp;
|
||||
unsigned char* clipbuf;
|
||||
int32_t unit;
|
||||
int decimals;
|
||||
|
|
@ -789,8 +790,12 @@ int talk_id(int32_t id, bool enqueue)
|
|||
return -1;
|
||||
#endif
|
||||
|
||||
/* try to get audio buffer until talkbuf_init() is called */
|
||||
if (!voicebuf)
|
||||
voicebuf = audio_get_buffer(true, &temp);
|
||||
|
||||
if (p_voicefile == NULL && has_voicefile)
|
||||
load_voicefile(false, voicebuf, voicefile_size); /* reload needed */
|
||||
load_voicefile(false, voicebuf, MIN(voicefile_size,temp)); /* reload needed */
|
||||
|
||||
if (p_voicefile == NULL) /* still no voices? */
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue