summaryrefslogtreecommitdiff
path: root/apps/codecs/aac.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/aac.c')
-rw-r--r--apps/codecs/aac.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c
index 9b07fb8d64..5bb9241d3b 100644
--- a/apps/codecs/aac.c
+++ b/apps/codecs/aac.c
@@ -66,8 +66,8 @@ enum codec_status codec_start(struct codec_api* api)
66 66
67 ci->configure(CODEC_DSP_ENABLE, (bool *)true); 67 ci->configure(CODEC_DSP_ENABLE, (bool *)true);
68 ci->configure(DSP_DITHER, (bool *)false); 68 ci->configure(DSP_DITHER, (bool *)false);
69 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_INTERLEAVED); 69 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_NONINTERLEAVED);
70 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(16)); 70 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(29));
71 71
72 next_track: 72 next_track:
73 73
@@ -100,7 +100,7 @@ enum codec_status codec_start(struct codec_api* api)
100 } 100 }
101 101
102 NeAACDecConfigurationPtr conf = NeAACDecGetCurrentConfiguration(hDecoder); 102 NeAACDecConfigurationPtr conf = NeAACDecGetCurrentConfiguration(hDecoder);
103 conf->outputFormat = 1; // 16-bit integers 103 conf->outputFormat = FAAD_FMT_24BIT; /* irrelevant, we don't convert */
104 NeAACDecSetConfiguration(hDecoder, conf); 104 NeAACDecSetConfiguration(hDecoder, conf);
105 105
106 unsigned long s=0; 106 unsigned long s=0;
@@ -147,7 +147,8 @@ enum codec_status codec_start(struct codec_api* api)
147 /* Decode one block - returned samples will be host-endian */ 147 /* Decode one block - returned samples will be host-endian */
148 rb->yield(); 148 rb->yield();
149 decodedbuffer = NeAACDecDecode(hDecoder, &frameInfo, buffer, n); 149 decodedbuffer = NeAACDecDecode(hDecoder, &frameInfo, buffer, n);
150 150 /* ignore decodedbuffer return value, we access samples in the
151 decoder struct directly */
151 if (frameInfo.error > 0) { 152 if (frameInfo.error > 0) {
152 LOGF("FAAD: decoding error \"%s\"\n", NeAACDecGetErrorMessage(frameInfo.error)); 153 LOGF("FAAD: decoding error \"%s\"\n", NeAACDecGetErrorMessage(frameInfo.error));
153 return CODEC_ERROR; 154 return CODEC_ERROR;
@@ -161,7 +162,9 @@ enum codec_status codec_start(struct codec_api* api)
161 162
162 /* Output the audio */ 163 /* Output the audio */
163 rb->yield(); 164 rb->yield();
164 while (!rb->pcmbuf_insert((char*)decodedbuffer, frameInfo.samples << 1)) 165 while (!rb->pcmbuf_insert_split(hDecoder->time_out[0],
166 hDecoder->time_out[1],
167 frameInfo.samples*2))
165 rb->yield(); 168 rb->yield();
166 169
167 /* Update the elapsed-time indicator */ 170 /* Update the elapsed-time indicator */