diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-10-09 12:30:37 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-10-09 12:30:37 +0000 |
commit | 889690c0f60a2ce2cdfd985895d0484c78083df1 (patch) | |
tree | 2b40d92a48d777319584ba5f161ce844970d6f3d /apps/mpeg.c | |
parent | aed39dbbafc2f1cacfdce4382f22b06ab0224aae (diff) | |
download | rockbox-889690c0f60a2ce2cdfd985895d0484c78083df1.tar.gz rockbox-889690c0f60a2ce2cdfd985895d0484c78083df1.zip |
Fix audio_get_buffer() implementation on hwcodec, to be similar to the swcodec one. Should make hwcodec bood again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30737 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/mpeg.c')
-rw-r--r-- | apps/mpeg.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/mpeg.c b/apps/mpeg.c index 2a2821bcda..b7db602120 100644 --- a/apps/mpeg.c +++ b/apps/mpeg.c @@ -558,8 +558,10 @@ unsigned char * audio_get_buffer(bool talk_buf, size_t *buffer_size) { (void)talk_buf; /* always grab the voice buffer for now */ - if (buffer_size) /* special case for talk_init() */ - audio_hard_stop(); + audio_hard_stop(); + + if (!buffer_size) /* special case for talk_init() */ + return NULL; if (!audiobuf_handle) { @@ -571,9 +573,9 @@ unsigned char * audio_get_buffer(bool talk_buf, size_t *buffer_size) *buffer_size = audiobuflen; } mpeg_audiobuf = core_get_data(audiobuf_handle); - - if (!buffer_size) /* special case for talk_init() */ - talkbuf_init(mpeg_audiobuf); + /* tell talk about the new buffer, don't re-enable just yet because the + * buffer is stolen */ + talkbuf_init(mpeg_audiobuf); return mpeg_audiobuf; } |