summaryrefslogtreecommitdiff
path: root/lib/rbcodec/metadata
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/metadata')
-rw-r--r--lib/rbcodec/metadata/metadata.h4
-rw-r--r--lib/rbcodec/metadata/mpc.c2
-rw-r--r--lib/rbcodec/metadata/oma.c5
-rw-r--r--lib/rbcodec/metadata/rm.c2
-rw-r--r--lib/rbcodec/metadata/tta.c8
-rw-r--r--lib/rbcodec/metadata/wave.c6
6 files changed, 7 insertions, 20 deletions
diff --git a/lib/rbcodec/metadata/metadata.h b/lib/rbcodec/metadata/metadata.h
index eda1fb0d7d..b30979334a 100644
--- a/lib/rbcodec/metadata/metadata.h
+++ b/lib/rbcodec/metadata/metadata.h
@@ -272,10 +272,6 @@ struct mp3entry {
272 bool has_toc; /* True if there is a VBR header in the file */ 272 bool has_toc; /* True if there is a VBR header in the file */
273 unsigned char toc[100]; /* table of contents */ 273 unsigned char toc[100]; /* table of contents */
274 274
275 /* Added for ATRAC3 */
276 unsigned int channels; /* Number of channels in the stream */
277 unsigned int extradata_size; /* Size (in bytes) of the codec's extradata from the container */
278
279 /* Added for AAC HE SBR */ 275 /* Added for AAC HE SBR */
280 bool needs_upsampling_correction; /* flag used by aac codec */ 276 bool needs_upsampling_correction; /* flag used by aac codec */
281 277
diff --git a/lib/rbcodec/metadata/mpc.c b/lib/rbcodec/metadata/mpc.c
index 3c0ee0707d..346053dd3e 100644
--- a/lib/rbcodec/metadata/mpc.c
+++ b/lib/rbcodec/metadata/mpc.c
@@ -163,7 +163,7 @@ bool get_musepack_metadata(int fd, struct mp3entry *id3)
163 id3->frequency = sfreqs[(sv8_header[k++] >> 5) & 0x0003]; 163 id3->frequency = sfreqs[(sv8_header[k++] >> 5) & 0x0003];
164 164
165 /* Number of channels */ 165 /* Number of channels */
166 id3->channels = (sv8_header[k++] >> 4) + 1; 166 //uint8_t channels = (sv8_header[k++] >> 4) + 1;
167 167
168 /* Skip to next tag: k = size -2 */ 168 /* Skip to next tag: k = size -2 */
169 k = size - 2; 169 k = size - 2;
diff --git a/lib/rbcodec/metadata/oma.c b/lib/rbcodec/metadata/oma.c
index 3573d58808..3afa1aad70 100644
--- a/lib/rbcodec/metadata/oma.c
+++ b/lib/rbcodec/metadata/oma.c
@@ -149,10 +149,6 @@ static int oma_read_header(int fd, struct mp3entry* id3)
149 149
150 id3->bitrate = id3->frequency * id3->bytesperframe * 8 / (1024 * 1000); 150 id3->bitrate = id3->frequency * id3->bytesperframe * 8 / (1024 * 1000);
151 151
152 /* fake the atrac3 extradata (wav format, makes stream copy to wav work) */
153 /* ATRAC3 expects and extra-data size of 14 bytes for wav format, and *
154 * looks for that in the id3v2buf. */
155 id3->extradata_size = 14;
156 AV_WL16(&id3->id3v2buf[0], 1); // always 1 152 AV_WL16(&id3->id3v2buf[0], 1); // always 1
157 AV_WL32(&id3->id3v2buf[2], id3->frequency); // samples rate 153 AV_WL32(&id3->id3v2buf[2], id3->frequency); // samples rate
158 AV_WL16(&id3->id3v2buf[6], jsflag); // coding mode 154 AV_WL16(&id3->id3v2buf[6], jsflag); // coding mode
@@ -160,7 +156,6 @@ static int oma_read_header(int fd, struct mp3entry* id3)
160 AV_WL16(&id3->id3v2buf[10], 1); // always 1 156 AV_WL16(&id3->id3v2buf[10], 1); // always 1
161 AV_WL16(&id3->id3v2buf[12], 0); // always 0 157 AV_WL16(&id3->id3v2buf[12], 0); // always 0
162 158
163 id3->channels = 2;
164 DEBUGF("sample_rate = %d\n", id3->frequency); 159 DEBUGF("sample_rate = %d\n", id3->frequency);
165 DEBUGF("frame_size = %d\n", id3->bytesperframe); 160 DEBUGF("frame_size = %d\n", id3->bytesperframe);
166 DEBUGF("stereo_coding_mode = %d\n", jsflag); 161 DEBUGF("stereo_coding_mode = %d\n", jsflag);
diff --git a/lib/rbcodec/metadata/rm.c b/lib/rbcodec/metadata/rm.c
index 1e33f0b0ac..16ffe17b14 100644
--- a/lib/rbcodec/metadata/rm.c
+++ b/lib/rbcodec/metadata/rm.c
@@ -502,8 +502,6 @@ bool get_rm_metadata(int fd, struct mp3entry* id3)
502 break; 502 break;
503 } 503 }
504 504
505 id3->channels = rmctx->nb_channels;
506 id3->extradata_size = rmctx->extradata_size;
507 id3->bitrate = (rmctx->bit_rate + 500) / 1000; 505 id3->bitrate = (rmctx->bit_rate + 500) / 1000;
508 id3->frequency = rmctx->sample_rate; 506 id3->frequency = rmctx->sample_rate;
509 id3->length = rmctx->duration; 507 id3->length = rmctx->duration;
diff --git a/lib/rbcodec/metadata/tta.c b/lib/rbcodec/metadata/tta.c
index 5f99c4776e..a481d8dd21 100644
--- a/lib/rbcodec/metadata/tta.c
+++ b/lib/rbcodec/metadata/tta.c
@@ -93,21 +93,21 @@ bool get_tta_metadata(int fd, struct mp3entry* id3)
93 93
94 /* skip check CRC */ 94 /* skip check CRC */
95 95
96 id3->channels = (GET_HEADER(ttahdr, NUM_CHANNELS)); 96 unsigned short channels = (GET_HEADER(ttahdr, NUM_CHANNELS));
97 id3->frequency = (GET_HEADER(ttahdr, SAMPLE_RATE)); 97 id3->frequency = (GET_HEADER(ttahdr, SAMPLE_RATE));
98 id3->length = ((GET_HEADER(ttahdr, DATA_LENGTH)) / id3->frequency) * 1000LL; 98 id3->length = ((GET_HEADER(ttahdr, DATA_LENGTH)) / id3->frequency) * 1000LL;
99 bps = (GET_HEADER(ttahdr, BITS_PER_SAMPLE)); 99 bps = (GET_HEADER(ttahdr, BITS_PER_SAMPLE));
100 100
101 datasize = id3->filesize - id3->first_frame_offset; 101 datasize = id3->filesize - id3->first_frame_offset;
102 origsize = (GET_HEADER(ttahdr, DATA_LENGTH)) * ((bps + 7) / 8) * id3->channels; 102 origsize = (GET_HEADER(ttahdr, DATA_LENGTH)) * ((bps + 7) / 8) * channels;
103 103
104 id3->bitrate = (int) ((uint64_t) datasize * id3->frequency * id3->channels * bps 104 id3->bitrate = (int) ((uint64_t) datasize * id3->frequency * channels * bps
105 / (origsize * 1000LL)); 105 / (origsize * 1000LL));
106 106
107 /* output header info (for debug) */ 107 /* output header info (for debug) */
108 DEBUGF("TTA header info ----\n"); 108 DEBUGF("TTA header info ----\n");
109 DEBUGF("id: %x\n", (unsigned int)(GET_HEADER(ttahdr, ID))); 109 DEBUGF("id: %x\n", (unsigned int)(GET_HEADER(ttahdr, ID)));
110 DEBUGF("channels: %d\n", id3->channels); 110 DEBUGF("channels: %d\n", channels);
111 DEBUGF("frequency: %ld\n", id3->frequency); 111 DEBUGF("frequency: %ld\n", id3->frequency);
112 DEBUGF("length: %ld\n", id3->length); 112 DEBUGF("length: %ld\n", id3->length);
113 DEBUGF("bitrate: %d\n", id3->bitrate); 113 DEBUGF("bitrate: %d\n", id3->bitrate);
diff --git a/lib/rbcodec/metadata/wave.c b/lib/rbcodec/metadata/wave.c
index 3fb051dd3c..2c918d1357 100644
--- a/lib/rbcodec/metadata/wave.c
+++ b/lib/rbcodec/metadata/wave.c
@@ -160,7 +160,7 @@ static void set_totalsamples(struct wave_fmt *fmt, struct mp3entry* id3)
160 fmt->samplesperblock = 1; 160 fmt->samplesperblock = 1;
161 break; 161 break;
162 case WAVE_FORMAT_YAMAHA_ADPCM: 162 case WAVE_FORMAT_YAMAHA_ADPCM:
163 if (id3->channels != 0) 163 if (fmt->channels != 0)
164 { 164 {
165 fmt->samplesperblock = 165 fmt->samplesperblock =
166 (fmt->blockalign == ((id3->frequency / 60) + 4) * fmt->channels)? 166 (fmt->blockalign == ((id3->frequency / 60) + 4) * fmt->channels)?
@@ -172,7 +172,7 @@ static void set_totalsamples(struct wave_fmt *fmt, struct mp3entry* id3)
172 fmt->samplesperblock = 2; 172 fmt->samplesperblock = 2;
173 break; 173 break;
174 case WAVE_FORMAT_SWF_ADPCM: 174 case WAVE_FORMAT_SWF_ADPCM:
175 if (fmt->bitspersample != 0 && id3->channels != 0) 175 if (fmt->bitspersample != 0 && fmt->channels != 0)
176 { 176 {
177 fmt->samplesperblock 177 fmt->samplesperblock
178 = (((fmt->blockalign << 3) - 2) / fmt->channels - 22) 178 = (((fmt->blockalign << 3) - 2) / fmt->channels - 22)
@@ -226,8 +226,6 @@ static void parse_riff_format(unsigned char* buf, int fmtsize, struct wave_fmt *
226 if(id3->bitrate == 66 || id3->bitrate == 94) 226 if(id3->bitrate == 66 || id3->bitrate == 94)
227 jsflag = 1; 227 jsflag = 1;
228 228
229 id3->extradata_size = 14;
230 id3->channels = 2;
231 id3->codectype = AFMT_OMA_ATRAC3; 229 id3->codectype = AFMT_OMA_ATRAC3;
232 id3->bytesperframe = fmt->blockalign; 230 id3->bytesperframe = fmt->blockalign;
233 231