Backport r30060 to v3.9 branch. Fixes a possible RealAudio decoder failure.

git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_9@30061 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-06-24 09:29:25 +00:00
parent d348615dee
commit 3562e0fb1f
3 changed files with 5 additions and 4 deletions

View file

@ -89,7 +89,7 @@ enum codec_status codec_run(void)
fs = rmctx.audio_framesize;
sps= rmctx.block_align;
h = rmctx.sub_packet_h;
scrambling_unit_size = h*fs;
scrambling_unit_size = h * (fs + PACKET_HEADER_SIZE);
res = atrac3_decode_init(&q, ci->id3);
if(res < 0) {

View file

@ -88,7 +88,7 @@ enum codec_status codec_run(void)
fs = rmctx.audio_framesize;
sps= rmctx.block_align;
h = rmctx.sub_packet_h;
scrambling_unit_size = h*fs;
scrambling_unit_size = h * (fs + PACKET_HEADER_SIZE);
res =cook_decode_init(&rmctx, &q);
if(res < 0) {

View file

@ -541,8 +541,9 @@ int rm_get_packet(uint8_t **src,RMContext *rmctx, RMPacket *pkt)
if (!y)
rmctx->audiotimestamp = pkt->timestamp;
advance_buffer(src,12);
consumed += 12;
/* Skip packet header */
advance_buffer(src, PACKET_HEADER_SIZE);
consumed += PACKET_HEADER_SIZE;
if (rmctx->codec_type == CODEC_COOK || rmctx->codec_type == CODEC_ATRAC) {
for(x = 0 ; x < w/sps; x++)
{