summaryrefslogtreecommitdiff
path: root/apps/metadata
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-02-16 01:47:22 +0000
committerMohamed Tarek <mt@rockbox.org>2010-02-16 01:47:22 +0000
commit2e314093c8b9f594f0baa1a253125e6d87452eae (patch)
tree028870139ae1d63d49d01e5d583eaf0f4fa11a9e /apps/metadata
parent419e8aad783de1207d500c63854c29d0b1e343e8 (diff)
downloadrockbox-2e314093c8b9f594f0baa1a253125e6d87452eae.zip
rockbox-2e314093c8b9f594f0baa1a253125e6d87452eae.tar.gz
rockbox-2e314093c8b9f594f0baa1a253125e6d87452eae.tar.bz2
rockbox-2e314093c8b9f594f0baa1a253125e6d87452eae.tar.xz
"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.c21
-rw-r--r--apps/metadata/rm.c2
2 files changed, 13 insertions, 10 deletions
diff --git a/apps/metadata/oma.c b/apps/metadata/oma.c
index 695ae0b..0f42a57 100644
--- a/apps/metadata/oma.c
+++ b/apps/metadata/oma.c
@@ -137,7 +137,7 @@ int oma_read_header(int fd, struct mp3entry* id3)
case OMA_CODECID_ATRAC3:
id3->frequency = srate_tab[(codec_params >> 13) & 7]*100;
if (id3->frequency != 44100) {
- DEBUGF("Unsupported sample rate, send sample file to developers: %d\n", samplerate);
+ DEBUGF("Unsupported sample rate, send sample file to developers: %d\n", id3->frequency);
return -1;
}
@@ -149,16 +149,17 @@ int oma_read_header(int fd, struct mp3entry* id3)
/* fake the atrac3 extradata (wav format, makes stream copy to wav work) */
/* ATRAC3 expects and extra-data size of 14 bytes for wav format; extra-data size *
- * is stored in ATRAC3Context before initializing the decoder. See atrac3_oma.codec. *
+ * is stored in ATRAC3Context before initializing the decoder. *
* We use id3v2buf to hold the (fake) extra-data provided from the container. */
-
- AV_WL16(&id3->id3v1buf[0][0], 1); // always 1
- AV_WL32(&id3->id3v1buf[0][2], id3->frequency); // samples rate
- AV_WL16(&id3->id3v1buf[0][6], jsflag); // coding mode
- AV_WL16(&id3->id3v1buf[0][8], jsflag); // coding mode
- AV_WL16(&id3->id3v1buf[0][10], 1); // always 1
- AV_WL16(&id3->id3v1buf[0][12], 0); // always 0
-
+ id3->extradata_size = 14;
+ AV_WL16(&id3->id3v2buf[0], 1); // always 1
+ AV_WL32(&id3->id3v2buf[2], id3->frequency); // samples rate
+ AV_WL16(&id3->id3v2buf[6], jsflag); // coding mode
+ AV_WL16(&id3->id3v2buf[8], jsflag); // coding mode
+ AV_WL16(&id3->id3v2buf[10], 1); // always 1
+ AV_WL16(&id3->id3v2buf[12], 0); // always 0
+
+ id3->channels = 2;
DEBUGF("sample_rate = %d\n", id3->frequency);
DEBUGF("frame_size = %d\n", id3->bytesperframe);
DEBUGF("stereo_coding_mode = %d\n", jsflag);
diff --git a/apps/metadata/rm.c b/apps/metadata/rm.c
index 5740616..63328a3 100644
--- a/apps/metadata/rm.c
+++ b/apps/metadata/rm.c
@@ -438,6 +438,8 @@ bool get_rm_metadata(int fd, struct mp3entry* id3)
break;
}
+ id3->channels = rmctx->nb_channels;
+ id3->extradata_size = rmctx->extradata_size;
id3->bitrate = rmctx->bit_rate / 1000;
id3->frequency = rmctx->sample_rate;
id3->length = rmctx->duration;