summaryrefslogtreecommitdiff
path: root/apps/codecs/atrac3_rm.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/atrac3_rm.c')
-rw-r--r--apps/codecs/atrac3_rm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/codecs/atrac3_rm.c b/apps/codecs/atrac3_rm.c
index 41399fda3d..b8f8489b1a 100644
--- a/apps/codecs/atrac3_rm.c
+++ b/apps/codecs/atrac3_rm.c
@@ -34,7 +34,11 @@ ATRAC3Context q IBSS_ATTR;
34 34
35static void init_rm(RMContext *rmctx) 35static void init_rm(RMContext *rmctx)
36{ 36{
37 /* initialize the RMContext */
37 memcpy(rmctx, (void*)(( (intptr_t)ci->id3->id3v2buf + 3 ) &~ 3), sizeof(RMContext)); 38 memcpy(rmctx, (void*)(( (intptr_t)ci->id3->id3v2buf + 3 ) &~ 3), sizeof(RMContext));
39
40 /* and atrac3 expects extadata in id3v2buf, so we shall give it that */
41 memcpy(ci->id3->id3v2buf, (char*)rmctx->codec_extradata, rmctx->extradata_size*sizeof(char));
38} 42}
39 43
40/* this is the codec entry point */ 44/* this is the codec entry point */
@@ -77,7 +81,7 @@ next_track:
77 h = rmctx.sub_packet_h; 81 h = rmctx.sub_packet_h;
78 scrambling_unit_size = h*fs; 82 scrambling_unit_size = h*fs;
79 83
80 res =atrac3_decode_init(&q, &rmctx); 84 res =atrac3_decode_init(&q, ci->id3);
81 if(res < 0) { 85 if(res < 0) {
82 DEBUGF("failed to initialize atrac decoder\n"); 86 DEBUGF("failed to initialize atrac decoder\n");
83 return CODEC_ERROR; 87 return CODEC_ERROR;
@@ -168,7 +172,7 @@ seek_start :
168 ci->seek_complete(); 172 ci->seek_complete();
169 } 173 }
170 if(pkt.length) 174 if(pkt.length)
171 res = atrac3_decode_frame(&rmctx, &q, &datasize, pkt.frames[i], rmctx.block_align); 175 res = atrac3_decode_frame(rmctx.block_align, &q, &datasize, pkt.frames[i], rmctx.block_align);
172 else /* indicates that there are no remaining frames */ 176 else /* indicates that there are no remaining frames */
173 goto done; 177 goto done;
174 178