X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=tests%2Fapi%2Fapi-flac-test.c;h=3fea3258f319bff6756beec9e9e24071f6aca62e;hb=09a39042db1b34672ba92a29c2b2f8f18a588a40;hp=e8e8cbf1e7c8abd9c81f653387b8ffd58f3dd26d;hpb=493240a522fca34882601fbeeda4e17aa40a0303;p=ffmpeg diff --git a/tests/api/api-flac-test.c b/tests/api/api-flac-test.c index e8e8cbf1e7c..3fea3258f31 100644 --- a/tests/api/api-flac-test.c +++ b/tests/api/api-flac-test.c @@ -126,7 +126,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, in_frame->nb_samples = enc_ctx->frame_size; in_frame->format = enc_ctx->sample_fmt; in_frame->channel_layout = enc_ctx->channel_layout; - if (av_frame_get_buffer(in_frame, 32) != 0) { + if (av_frame_get_buffer(in_frame, 0) != 0) { av_log(NULL, AV_LOG_ERROR, "Can't allocate a buffer for input frame\n"); return AVERROR(ENOMEM); } @@ -223,20 +223,6 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, return 0; } -static int close_encoder(AVCodecContext **enc_ctx) -{ - avcodec_close(*enc_ctx); - av_freep(enc_ctx); - return 0; -} - -static int close_decoder(AVCodecContext **dec_ctx) -{ - avcodec_close(*dec_ctx); - av_freep(dec_ctx); - return 0; -} - int main(void) { AVCodec *enc = NULL, *dec = NULL; @@ -265,8 +251,8 @@ int main(void) return 1; if (run_test(enc, dec, enc_ctx, dec_ctx) != 0) return 1; - close_encoder(&enc_ctx); - close_decoder(&dec_ctx); + avcodec_free_context(&enc_ctx); + avcodec_free_context(&dec_ctx); } }