1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-29 05:57:37 +02:00

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.
This commit is contained in:
Anton Khirnov
2021-03-09 11:35:47 +01:00
parent b334fd39c9
commit 3f53c84847
3 changed files with 166 additions and 163 deletions

View File

@@ -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 */