summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libatrac
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libatrac')
-rw-r--r--lib/rbcodec/codecs/libatrac/atrac3.c12
-rw-r--r--lib/rbcodec/codecs/libatrac/atrac3.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/rbcodec/codecs/libatrac/atrac3.c b/lib/rbcodec/codecs/libatrac/atrac3.c
index bb52dd4cf0..f0098258b3 100644
--- a/lib/rbcodec/codecs/libatrac/atrac3.c
+++ b/lib/rbcodec/codecs/libatrac/atrac3.c
@@ -1156,8 +1156,8 @@ int atrac3_decode_frame(unsigned long block_align, ATRAC3Context *q,
1156 * Atrac3 initialization 1156 * Atrac3 initialization
1157 * 1157 *
1158 * @param rmctx pointer to the RMContext 1158 * @param rmctx pointer to the RMContext
1159 */ 1159 */
1160int atrac3_decode_init(ATRAC3Context *q, struct mp3entry *id3) 1160int atrac3_decode_init(ATRAC3Context *q, struct mp3entry *id3, uint16_t channels, uint32_t extradata_size)
1161{ 1161{
1162 int i; 1162 int i;
1163 uint8_t *edata_ptr = (uint8_t*)&id3->id3v2buf; 1163 uint8_t *edata_ptr = (uint8_t*)&id3->id3v2buf;
@@ -1168,14 +1168,14 @@ int atrac3_decode_init(ATRAC3Context *q, struct mp3entry *id3)
1168 1168
1169 /* Take data from the RM container. */ 1169 /* Take data from the RM container. */
1170 q->sample_rate = id3->frequency; 1170 q->sample_rate = id3->frequency;
1171 q->channels = id3->channels; 1171 q->channels = channels;
1172 q->bit_rate = id3->bitrate * 1000; 1172 q->bit_rate = id3->bitrate * 1000;
1173 q->bits_per_frame = id3->bytesperframe * 8; 1173 q->bits_per_frame = id3->bytesperframe * 8;
1174 q->bytes_per_frame = id3->bytesperframe; 1174 q->bytes_per_frame = id3->bytesperframe;
1175 1175
1176 /* Take care of the codec-specific extradata. */ 1176 /* Take care of the codec-specific extradata. */
1177 1177
1178 if (id3->extradata_size == 14) { 1178 if (extradata_size == 14) {
1179 /* Parse the extradata, WAV format */ 1179 /* Parse the extradata, WAV format */
1180 DEBUGF("[0-1] %d\n",rm_get_uint16le(&edata_ptr[0])); /* Unknown value always 1 */ 1180 DEBUGF("[0-1] %d\n",rm_get_uint16le(&edata_ptr[0])); /* Unknown value always 1 */
1181 q->samples_per_channel = rm_get_uint32le(&edata_ptr[2]); 1181 q->samples_per_channel = rm_get_uint32le(&edata_ptr[2]);
@@ -1200,7 +1200,7 @@ int atrac3_decode_init(ATRAC3Context *q, struct mp3entry *id3)
1200 return -1; 1200 return -1;
1201 } 1201 }
1202 1202
1203 } else if (id3->extradata_size == 10) { 1203 } else if (extradata_size == 10) {
1204 /* Parse the extradata, RM format. */ 1204 /* Parse the extradata, RM format. */
1205 q->atrac3version = rm_get_uint32be(&edata_ptr[0]); 1205 q->atrac3version = rm_get_uint32be(&edata_ptr[0]);
1206 q->samples_per_frame = rm_get_uint16be(&edata_ptr[4]); 1206 q->samples_per_frame = rm_get_uint16be(&edata_ptr[4]);
@@ -1239,7 +1239,7 @@ int atrac3_decode_init(ATRAC3Context *q, struct mp3entry *id3)
1239 return -1; 1239 return -1;
1240 } 1240 }
1241 1241
1242 if (id3->channels <= 0 || id3->channels > 2 ) { 1242 if (channels <= 0 || channels > 2 ) {
1243 DEBUGF("Channel configuration error!\n"); 1243 DEBUGF("Channel configuration error!\n");
1244 return -1; 1244 return -1;
1245 } 1245 }
diff --git a/lib/rbcodec/codecs/libatrac/atrac3.h b/lib/rbcodec/codecs/libatrac/atrac3.h
index 64086b6411..912924cf6c 100644
--- a/lib/rbcodec/codecs/libatrac/atrac3.h
+++ b/lib/rbcodec/codecs/libatrac/atrac3.h
@@ -107,7 +107,7 @@ typedef struct {
107 //@} 107 //@}
108} ATRAC3Context; 108} ATRAC3Context;
109 109
110int atrac3_decode_init(ATRAC3Context *q, struct mp3entry *id3); 110int atrac3_decode_init(ATRAC3Context *q, struct mp3entry *id3, uint16_t channels, uint32_t extradata_size);
111 111
112int atrac3_decode_frame(unsigned long block_align, ATRAC3Context *q, 112int atrac3_decode_frame(unsigned long block_align, ATRAC3Context *q,
113 int *data_size, const uint8_t *buf, int buf_size); 113 int *data_size, const uint8_t *buf, int buf_size);