- ff_fft_init(&q->fft, 7, 1);
- dsputil_init(&q->dsp, avctx);
+ if ((ret = ff_fft_init(&q->fft, 7, 1))) {
+ av_log(avctx, AV_LOG_INFO, "FFT init failed\n");
+ return ret;
+ }
+ ff_dsputil_init(&q->dsp, avctx);
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+ avctx->channel_layout = AV_CH_LAYOUT_MONO;
+
+ avcodec_get_frame_defaults(&q->frame);
+ avctx->coded_frame = &q->frame;
+