diff options
| author | Dan Everton <dan@iocaine.org> | 2007-02-10 06:11:30 +0000 |
|---|---|---|
| committer | Dan Everton <dan@iocaine.org> | 2007-02-10 06:11:30 +0000 |
| commit | 69c40d7e84eef3aba68321bf8c3e6196ff04a926 (patch) | |
| tree | 87e21c0ff54a0e50e80e47791bbca3ea92b83703 /apps/codecs | |
| parent | 161bf8f0e13deea20cb9c6b74b34acb5a3ce46be (diff) | |
| download | rockbox-69c40d7e84eef3aba68321bf8c3e6196ff04a926.zip rockbox-69c40d7e84eef3aba68321bf8c3e6196ff04a926.tar.gz rockbox-69c40d7e84eef3aba68321bf8c3e6196ff04a926.tar.bz2 rockbox-69c40d7e84eef3aba68321bf8c3e6196ff04a926.tar.xz | |
Fix stereo Speex file decoding.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12250 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
| -rw-r--r-- | apps/codecs/speex.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/apps/codecs/speex.c b/apps/codecs/speex.c index c786f40..c75a9b2 100644 --- a/apps/codecs/speex.c +++ b/apps/codecs/speex.c @@ -544,25 +544,23 @@ next_page: if (speex_bits_remaining(&vf) < 0) break; - if (channels==2) - speex_decode_stereo_int(output, frame_size,&stereo); - { - int new_frame_size = frame_size; + if (channels == 2) + speex_decode_stereo_int(output, frame_size, &stereo); - if (new_frame_size>0){ - rb->pcmbuf_insert((const char*)output, - (const char*)output, - new_frame_size*channels); + int new_frame_size = frame_size; - /* 2 bytes/sample */ - cur_granule += new_frame_size / 2; + if (new_frame_size>0){ + rb->pcmbuf_insert((const char*)output, NULL, + new_frame_size); - rb->set_offset((long)rb->curpos); + /* 2 bytes/sample */ + cur_granule += new_frame_size / 2; - rb->set_elapsed( (samplerate==0) ? 0 : - cur_granule*1000/samplerate); - } - } + rb->set_offset((long)rb->curpos); + + rb->set_elapsed( (samplerate==0) ? 0 : + cur_granule*1000/samplerate); + } } } packet_count++; |