1
0
Fork 0
forked from len0rd/rockbox

Avoid calls to audio and talk functions in audio_get_buffer until init is complete. Just good hygiene really.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11615 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2006-11-27 13:54:50 +00:00
parent a45e632495
commit a1af87ffe7

View file

@ -378,7 +378,8 @@ unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size)
{
unsigned char *buf, *end;
audio_stop();
if (audio_is_initialized)
audio_stop();
if (buffer_size == NULL)
{
@ -390,8 +391,8 @@ unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size)
buf = audiobuf;
end = audiobufend;
if (talk_buf || !talk_voice_required()
|| buffer_state == BUFFER_STATE_TRASHED)
if (talk_buf || buffer_state == BUFFER_STATE_TRASHED
|| !talk_voice_required())
{
logf("get buffer: talk_buf");
/* ok to use everything from audiobuf to audiobufend */