mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 21:55:10 -05:00
Fix stereo Speex file decoding.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12250 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
161bf8f0e1
commit
69c40d7e84
1 changed files with 13 additions and 15 deletions
|
|
@ -544,25 +544,23 @@ next_page:
|
||||||
if (speex_bits_remaining(&vf) < 0)
|
if (speex_bits_remaining(&vf) < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (channels==2)
|
if (channels == 2)
|
||||||
speex_decode_stereo_int(output, frame_size,&stereo);
|
speex_decode_stereo_int(output, frame_size, &stereo);
|
||||||
{
|
|
||||||
int new_frame_size = frame_size;
|
|
||||||
|
|
||||||
if (new_frame_size>0){
|
int new_frame_size = frame_size;
|
||||||
rb->pcmbuf_insert((const char*)output,
|
|
||||||
(const char*)output,
|
|
||||||
new_frame_size*channels);
|
|
||||||
|
|
||||||
/* 2 bytes/sample */
|
if (new_frame_size>0){
|
||||||
cur_granule += new_frame_size / 2;
|
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 :
|
rb->set_offset((long)rb->curpos);
|
||||||
cur_granule*1000/samplerate);
|
|
||||||
}
|
rb->set_elapsed( (samplerate==0) ? 0 :
|
||||||
}
|
cur_granule*1000/samplerate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
packet_count++;
|
packet_count++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue