From 3f53c848470cb8173699e0bd64e804a19af963f7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 9 Mar 2021 11:35:47 +0100 Subject: lavc: factor out encoder init/validation from avcodec_open2() avcodec_open2() is massive, splitting it makes it more readable. Also, add a missing error code to ticks_per_frame sanity check. --- libavcodec/encode.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libavcodec/encode.h') diff --git a/libavcodec/encode.h b/libavcodec/encode.h index 089c31091c..9af2f42483 100644 --- a/libavcodec/encode.h +++ b/libavcodec/encode.h @@ -44,4 +44,10 @@ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame); */ int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags); +/* + * Perform encoder initialization and validation. + * Called when opening the encoder, before the AVCodec.init() call. + */ +int ff_encode_preinit(AVCodecContext *avctx); + #endif /* AVCODEC_ENCODE_H */ -- cgit v1.2.3