From 2e314093c8b9f594f0baa1a253125e6d87452eae Mon Sep 17 00:00:00 2001 From: Mohamed Tarek Date: Tue, 16 Feb 2010 01:47:22 +0000 Subject: "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 --- apps/metadata/oma.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'apps/metadata/oma.c') 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) 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); -- cgit v1.2.3