diff options
-rw-r--r-- | apps/codecs/atrac3_rm.c | 2 | ||||
-rw-r--r-- | apps/codecs/cook.c | 2 | ||||
-rw-r--r-- | apps/codecs/librm/rm.c | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/apps/codecs/atrac3_rm.c b/apps/codecs/atrac3_rm.c index b666dd4513..997507425e 100644 --- a/apps/codecs/atrac3_rm.c +++ b/apps/codecs/atrac3_rm.c | |||
@@ -89,7 +89,7 @@ enum codec_status codec_run(void) | |||
89 | fs = rmctx.audio_framesize; | 89 | fs = rmctx.audio_framesize; |
90 | sps= rmctx.block_align; | 90 | sps= rmctx.block_align; |
91 | h = rmctx.sub_packet_h; | 91 | h = rmctx.sub_packet_h; |
92 | scrambling_unit_size = h*fs; | 92 | scrambling_unit_size = h * (fs + PACKET_HEADER_SIZE); |
93 | 93 | ||
94 | res = atrac3_decode_init(&q, ci->id3); | 94 | res = atrac3_decode_init(&q, ci->id3); |
95 | if(res < 0) { | 95 | if(res < 0) { |
diff --git a/apps/codecs/cook.c b/apps/codecs/cook.c index 5801ee63af..4a47e74f60 100644 --- a/apps/codecs/cook.c +++ b/apps/codecs/cook.c | |||
@@ -88,7 +88,7 @@ enum codec_status codec_run(void) | |||
88 | fs = rmctx.audio_framesize; | 88 | fs = rmctx.audio_framesize; |
89 | sps= rmctx.block_align; | 89 | sps= rmctx.block_align; |
90 | h = rmctx.sub_packet_h; | 90 | h = rmctx.sub_packet_h; |
91 | scrambling_unit_size = h*fs; | 91 | scrambling_unit_size = h * (fs + PACKET_HEADER_SIZE); |
92 | 92 | ||
93 | res =cook_decode_init(&rmctx, &q); | 93 | res =cook_decode_init(&rmctx, &q); |
94 | if(res < 0) { | 94 | if(res < 0) { |
diff --git a/apps/codecs/librm/rm.c b/apps/codecs/librm/rm.c index 6bc187bb5e..eabbe5d92a 100644 --- a/apps/codecs/librm/rm.c +++ b/apps/codecs/librm/rm.c | |||
@@ -541,8 +541,9 @@ int rm_get_packet(uint8_t **src,RMContext *rmctx, RMPacket *pkt) | |||
541 | if (!y) | 541 | if (!y) |
542 | rmctx->audiotimestamp = pkt->timestamp; | 542 | rmctx->audiotimestamp = pkt->timestamp; |
543 | 543 | ||
544 | advance_buffer(src,12); | 544 | /* Skip packet header */ |
545 | consumed += 12; | 545 | advance_buffer(src, PACKET_HEADER_SIZE); |
546 | consumed += PACKET_HEADER_SIZE; | ||
546 | if (rmctx->codec_type == CODEC_COOK || rmctx->codec_type == CODEC_ATRAC) { | 547 | if (rmctx->codec_type == CODEC_COOK || rmctx->codec_type == CODEC_ATRAC) { |
547 | for(x = 0 ; x < w/sps; x++) | 548 | for(x = 0 ; x < w/sps; x++) |
548 | { | 549 | { |