diff options
-rw-r--r-- | apps/talk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/talk.c b/apps/talk.c index ea6432dc21..b9bfdc82ac 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -402,7 +402,6 @@ static void load_voicefile(bool probe, char* buf, size_t bufsize) | |||
402 | 402 | ||
403 | if (alloc_size > bufsize) | 403 | if (alloc_size > bufsize) |
404 | goto load_err; | 404 | goto load_err; |
405 | return; | ||
406 | 405 | ||
407 | /* now move p_thumbnail behind the voice clip buffer */ | 406 | /* now move p_thumbnail behind the voice clip buffer */ |
408 | p_thumbnail = voicebuf.buf + alloc_size; | 407 | p_thumbnail = voicebuf.buf + alloc_size; |
@@ -414,6 +413,7 @@ static void load_voicefile(bool probe, char* buf, size_t bufsize) | |||
414 | if (size_for_thumbnail <= 0) | 413 | if (size_for_thumbnail <= 0) |
415 | p_thumbnail = NULL; | 414 | p_thumbnail = NULL; |
416 | 415 | ||
416 | return; | ||
417 | load_err: | 417 | load_err: |
418 | p_voicefile = NULL; | 418 | p_voicefile = NULL; |
419 | has_voicefile = false; /* don't try again */ | 419 | has_voicefile = false; /* don't try again */ |
@@ -778,7 +778,7 @@ void talk_buffer_steal(void) | |||
778 | int talk_id(int32_t id, bool enqueue) | 778 | int talk_id(int32_t id, bool enqueue) |
779 | { | 779 | { |
780 | long clipsize; | 780 | long clipsize; |
781 | size_t temp = voicefile_size; | 781 | size_t temp = talk_get_buffer(); |
782 | unsigned char* clipbuf; | 782 | unsigned char* clipbuf; |
783 | int32_t unit; | 783 | int32_t unit; |
784 | int decimals; | 784 | int decimals; |
@@ -795,7 +795,7 @@ int talk_id(int32_t id, bool enqueue) | |||
795 | voicebuf = audio_get_buffer(true, &temp); | 795 | voicebuf = audio_get_buffer(true, &temp); |
796 | 796 | ||
797 | if (p_voicefile == NULL && has_voicefile) | 797 | if (p_voicefile == NULL && has_voicefile) |
798 | load_voicefile(false, voicebuf, MIN(voicefile_size,temp)); /* reload needed */ | 798 | load_voicefile(false, voicebuf, MIN(talk_get_buffer(),temp)); /* reload needed */ |
799 | 799 | ||
800 | if (p_voicefile == NULL) /* still no voices? */ | 800 | if (p_voicefile == NULL) /* still no voices? */ |
801 | return -1; | 801 | return -1; |