On 09/24/2014 10:48 AM, Omer Osman wrote:
+        switch (downmix_channels){
+          case 2:
+          case 1:
+              if(aacDecoder_SetParam(s->handle, AAC_PCM_OUTPUT_CHANNELS, 
downmix_channels) != AAC_DEC_OK){
+                  av_log(avctx, AV_LOG_ERROR, "Unable to set output channels in the 
decoder\n");
+                  return AVERROR_UNKNOWN;
+              }
+              break;

If FDK-AAC actually downmixes to mono and stereo, those channel layouts should be checked, not the channel count.

+          default:
+              av_log(avctx, AV_LOG_ERROR, "Invalid request_channel_layout\n");
+              return AVERROR_UNKNOWN;
+        }

It's actually fine for the decoder to ignore the requested layout and not fail.

+    frame->nb_samples = avctx->frame_size;
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+        goto end;
+    memcpy(frame->extended_data[0], s->decoder_buffer,
+           avctx->channels * avctx->frame_size *
+           av_get_bytes_per_sample(avctx->sample_fmt));

I'm not thrilled about making the memcpy() unconditional. Can this be avoided when not downmixing?

-Justin

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to