]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/eac3enc.c
cavsdec: switch to av_assert
[ffmpeg] / libavcodec / eac3enc.c
index 75113b272f5d3f697fe0a9fcf6f586002bc8e880..e11b29c161b8c5f9733dfb8bcf1c94fea5ac0836 100644 (file)
 
 #define AC3ENC_TYPE AC3ENC_TYPE_EAC3
 #include "ac3enc_opts_template.c"
-static const AVClass eac3enc_class = { "E-AC-3 Encoder", av_default_item_name,
-                                       eac3_options, LIBAVUTIL_VERSION_INT };
 
+static const AVClass eac3enc_class = {
+    .class_name = "E-AC-3 Encoder",
+    .item_name  = av_default_item_name,
+    .option     = ac3_options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
 
 /**
  * LUT for finding a matching frame exponent strategy index from a set of
@@ -99,7 +103,7 @@ void ff_eac3_set_cpl_states(AC3EncodeContext *s)
         for (ch = 1; ch <= s->fbw_channels; ch++) {
             if (block->channel_in_cpl[ch]) {
                 if (first_cpl_coords[ch]) {
-                    block->new_cpl_coords = 2;
+                    block->new_cpl_coords[ch] = 2;
                     first_cpl_coords[ch]  = 0;
                 }
             } else {
@@ -252,11 +256,13 @@ AVCodec ff_eac3_encoder = {
     .id              = CODEC_ID_EAC3,
     .priv_data_size  = sizeof(AC3EncodeContext),
     .init            = ff_ac3_encode_init,
-    .encode          = ff_ac3_float_encode_frame,
+    .encode2         = ff_ac3_float_encode_frame,
     .close           = ff_ac3_encode_close,
-    .sample_fmts     = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_FLT,AV_SAMPLE_FMT_NONE},
+    .sample_fmts     = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
+                                                      AV_SAMPLE_FMT_NONE },
     .long_name       = NULL_IF_CONFIG_SMALL("ATSC A/52 E-AC-3"),
     .priv_class      = &eac3enc_class,
     .channel_layouts = ff_ac3_channel_layouts,
+    .defaults        = ac3_defaults,
 };
 #endif