]> git.sesse.net Git - ffmpeg/blobdiff - tests/api/api-flac-test.c
avcodec/codec, allcodecs: Constify the AVCodec API
[ffmpeg] / tests / api / api-flac-test.c
index f3bfbc95b503cf5427f33d61fd50ae0a7ef08b90..88b15e87229de7fc22ff8513b014b76613a06fd9 100644 (file)
@@ -48,7 +48,7 @@ static int generate_raw_frame(uint16_t *frame_data, int i, int sample_rate,
     return 0;
 }
 
-static int init_encoder(AVCodec *enc, AVCodecContext **enc_ctx,
+static int init_encoder(const AVCodec *enc, AVCodecContext **enc_ctx,
                         int64_t ch_layout, int sample_rate)
 {
     AVCodecContext *ctx;
@@ -78,7 +78,7 @@ static int init_encoder(AVCodec *enc, AVCodecContext **enc_ctx,
     return 0;
 }
 
-static int init_decoder(AVCodec *dec, AVCodecContext **dec_ctx,
+static int init_decoder(const AVCodec *dec, AVCodecContext **dec_ctx,
                         int64_t ch_layout)
 {
     AVCodecContext *ctx;
@@ -105,8 +105,8 @@ static int init_decoder(AVCodec *dec, AVCodecContext **dec_ctx,
     return 0;
 }
 
-static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx,
-                    AVCodecContext *dec_ctx)
+static int run_test(const AVCodec *enc, const AVCodec *dec,
+                    AVCodecContext *enc_ctx, AVCodecContext *dec_ctx)
 {
     AVPacket *enc_pkt;
     AVFrame *in_frame, *out_frame;
@@ -244,7 +244,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx,
 
 int main(void)
 {
-    AVCodec *enc = NULL, *dec = NULL;
+    const AVCodec *enc = NULL, *dec = NULL;
     AVCodecContext *enc_ctx = NULL, *dec_ctx = NULL;
     uint64_t channel_layouts[] = {AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_STEREO_DOWNMIX};
     int sample_rates[] = {8000, 44100, 48000, 192000};