summaryrefslogtreecommitdiff
path: root/apps/metadata/oma.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/metadata/oma.c')
-rw-r--r--apps/metadata/oma.c21
1 files changed, 11 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);