#include <fdk-aac/aacenc_lib.h>
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
#include "avcodec.h"
#include "audio_frame_queue.h"
#include "internal.h"
-#include "libavutil/audioconvert.h"
-#include "libavutil/common.h"
-#include "libavutil/opt.h"
typedef struct AACContext {
const AVClass *class;
}
if (avctx->cutoff > 0) {
- if (avctx->cutoff < (avctx->sample_rate + 255) >> 8) {
+ if (avctx->cutoff < (avctx->sample_rate + 255) >> 8 || avctx->cutoff > 20000) {
av_log(avctx, AV_LOG_ERROR, "cutoff valid range is %d-20000\n",
(avctx->sample_rate + 255) >> 8);
goto error;
}
if ((err = aacEncoder_SetParam(s->handle, AACENC_BANDWIDTH,
avctx->cutoff)) != AACENC_OK) {
- av_log(avctx, AV_LOG_ERROR, "Unable to set the encoder bandwith to %d: %s\n",
+ av_log(avctx, AV_LOG_ERROR, "Unable to set the encoder bandwidth to %d: %s\n",
avctx->cutoff, aac_get_error(err));
goto error;
}
in_buf.bufElSizes = &in_buffer_element_size;
/* add current frame to the queue */
- if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
+ if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
return ret;
}