diff options
author | Mohamed Tarek <mt@rockbox.org> | 2010-02-16 01:47:22 +0000 |
---|---|---|
committer | Mohamed Tarek <mt@rockbox.org> | 2010-02-16 01:47:22 +0000 |
commit | 2e314093c8b9f594f0baa1a253125e6d87452eae (patch) | |
tree | 028870139ae1d63d49d01e5d583eaf0f4fa11a9e /apps/codecs/atrac3_rm.c | |
parent | 419e8aad783de1207d500c63854c29d0b1e343e8 (diff) | |
download | rockbox-2e314093c8b9f594f0baa1a253125e6d87452eae.tar.gz rockbox-2e314093c8b9f594f0baa1a253125e6d87452eae.zip |
"Detach" ATRAC3 from RM. Since ATRAC3 isn't really specific to RM, it must not be obligatory to initialize the decoder through RMContext.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24682 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/atrac3_rm.c')
-rw-r--r-- | apps/codecs/atrac3_rm.c | 8 |
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 | ||
35 | static void init_rm(RMContext *rmctx) | 35 | static 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 | ||