]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ac3enc_float.c
avcodec/ac3enc: Set function pointers earlier
[ffmpeg] / libavcodec / ac3enc_float.c
index d6e658b2b42bd16e5606ddf5d232914629d4ae35..ef23b417cf3345b4d8fdf1509b91e1d27585fdf0 100644 (file)
@@ -94,7 +94,7 @@ static void sum_square_butterfly(AC3EncodeContext *s, float sum[4],
  *
  * @param s  AC-3 encoder private context
  */
-av_cold void ff_ac3_float_mdct_end(AC3EncodeContext *s)
+static av_cold void ac3_float_mdct_end(AC3EncodeContext *s)
 {
     ff_mdct_end(&s->mdct);
     av_freep(&s->mdct_window);
@@ -107,7 +107,7 @@ av_cold void ff_ac3_float_mdct_end(AC3EncodeContext *s)
  * @param s  AC-3 encoder private context
  * @return   0 on success, negative error code on failure
  */
-av_cold int ff_ac3_float_mdct_init(AC3EncodeContext *s)
+static av_cold int ac3_float_mdct_init(AC3EncodeContext *s)
 {
     float *window;
     int i, n, n2;
@@ -132,6 +132,9 @@ av_cold int ff_ac3_float_mdct_init(AC3EncodeContext *s)
 av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx)
 {
     AC3EncodeContext *s = avctx->priv_data;
+    s->mdct_end                = ac3_float_mdct_end;
+    s->mdct_init               = ac3_float_mdct_init;
+    s->allocate_sample_buffers = allocate_sample_buffers;
     s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
     if (!s->fdsp)
         return AVERROR(ENOMEM);
@@ -150,6 +153,8 @@ AVCodec ff_ac3_encoder = {
     .sample_fmts     = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
                                                       AV_SAMPLE_FMT_NONE },
     .priv_class      = &ac3enc_class,
+    .supported_samplerates = ff_ac3_sample_rate_tab,
     .channel_layouts = ff_ac3_channel_layouts,
     .defaults        = ac3_defaults,
+    .caps_internal   = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 };