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/metadata | |
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/metadata')
-rw-r--r-- | apps/metadata/oma.c | 21 | ||||
-rw-r--r-- | apps/metadata/rm.c | 2 |
2 files changed, 13 insertions, 10 deletions
diff --git a/apps/metadata/oma.c b/apps/metadata/oma.c index 695ae0b114..0f42a57a8c 100644 --- a/apps/metadata/oma.c +++ b/apps/metadata/oma.c | |||
@@ -137,7 +137,7 @@ int oma_read_header(int fd, struct mp3entry* id3) | |||
137 | case OMA_CODECID_ATRAC3: | 137 | case OMA_CODECID_ATRAC3: |
138 | id3->frequency = srate_tab[(codec_params >> 13) & 7]*100; | 138 | id3->frequency = srate_tab[(codec_params >> 13) & 7]*100; |
139 | if (id3->frequency != 44100) { | 139 | if (id3->frequency != 44100) { |
140 | DEBUGF("Unsupported sample rate, send sample file to developers: %d\n", samplerate); | 140 | DEBUGF("Unsupported sample rate, send sample file to developers: %d\n", id3->frequency); |
141 | return -1; | 141 | return -1; |
142 | } | 142 | } |
143 | 143 | ||
@@ -149,16 +149,17 @@ int oma_read_header(int fd, struct mp3entry* id3) | |||
149 | 149 | ||
150 | /* fake the atrac3 extradata (wav format, makes stream copy to wav work) */ | 150 | /* fake the atrac3 extradata (wav format, makes stream copy to wav work) */ |
151 | /* ATRAC3 expects and extra-data size of 14 bytes for wav format; extra-data size * | 151 | /* ATRAC3 expects and extra-data size of 14 bytes for wav format; extra-data size * |
152 | * is stored in ATRAC3Context before initializing the decoder. See atrac3_oma.codec. * | 152 | * is stored in ATRAC3Context before initializing the decoder. * |
153 | * We use id3v2buf to hold the (fake) extra-data provided from the container. */ | 153 | * We use id3v2buf to hold the (fake) extra-data provided from the container. */ |
154 | 154 | id3->extradata_size = 14; | |
155 | AV_WL16(&id3->id3v1buf[0][0], 1); // always 1 | 155 | AV_WL16(&id3->id3v2buf[0], 1); // always 1 |
156 | AV_WL32(&id3->id3v1buf[0][2], id3->frequency); // samples rate | 156 | AV_WL32(&id3->id3v2buf[2], id3->frequency); // samples rate |
157 | AV_WL16(&id3->id3v1buf[0][6], jsflag); // coding mode | 157 | AV_WL16(&id3->id3v2buf[6], jsflag); // coding mode |
158 | AV_WL16(&id3->id3v1buf[0][8], jsflag); // coding mode | 158 | AV_WL16(&id3->id3v2buf[8], jsflag); // coding mode |
159 | AV_WL16(&id3->id3v1buf[0][10], 1); // always 1 | 159 | AV_WL16(&id3->id3v2buf[10], 1); // always 1 |
160 | AV_WL16(&id3->id3v1buf[0][12], 0); // always 0 | 160 | AV_WL16(&id3->id3v2buf[12], 0); // always 0 |
161 | 161 | ||
162 | id3->channels = 2; | ||
162 | DEBUGF("sample_rate = %d\n", id3->frequency); | 163 | DEBUGF("sample_rate = %d\n", id3->frequency); |
163 | DEBUGF("frame_size = %d\n", id3->bytesperframe); | 164 | DEBUGF("frame_size = %d\n", id3->bytesperframe); |
164 | DEBUGF("stereo_coding_mode = %d\n", jsflag); | 165 | DEBUGF("stereo_coding_mode = %d\n", jsflag); |
diff --git a/apps/metadata/rm.c b/apps/metadata/rm.c index 5740616042..63328a3ab1 100644 --- a/apps/metadata/rm.c +++ b/apps/metadata/rm.c | |||
@@ -438,6 +438,8 @@ bool get_rm_metadata(int fd, struct mp3entry* id3) | |||
438 | break; | 438 | break; |
439 | } | 439 | } |
440 | 440 | ||
441 | id3->channels = rmctx->nb_channels; | ||
442 | id3->extradata_size = rmctx->extradata_size; | ||
441 | id3->bitrate = rmctx->bit_rate / 1000; | 443 | id3->bitrate = rmctx->bit_rate / 1000; |
442 | id3->frequency = rmctx->sample_rate; | 444 | id3->frequency = rmctx->sample_rate; |
443 | id3->length = rmctx->duration; | 445 | id3->length = rmctx->duration; |