diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-03-10 16:40:39 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-03-13 02:16:27 +0100 |
commit | 47d7c6cd15716127b867125e6ae088043f5e7b31 (patch) | |
tree | 77be83263309f240225500a668a9e2811846396d /libavcodec/utils.c | |
parent | 3e19e5062c42c6edc901b36fb68ef89c0cb93d9d (diff) | |
download | ffmpeg-47d7c6cd15716127b867125e6ae088043f5e7b31.tar.gz |
avcodec/codec_internal: Add dedicated is_decoder flag to FFCodec
Allows to simplify av_codec_is_decoder() and av_codec_is_encoder().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 0aa5a6f55e..90867ed6b1 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -79,17 +79,13 @@ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size) int av_codec_is_encoder(const AVCodec *avcodec) { const FFCodec *const codec = ffcodec(avcodec); - return codec && (codec->cb_type == FF_CODEC_CB_TYPE_ENCODE || - codec->cb_type == FF_CODEC_CB_TYPE_ENCODE_SUB || - codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_PACKET); + return codec && !codec->is_decoder; } int av_codec_is_decoder(const AVCodec *avcodec) { const FFCodec *const codec = ffcodec(avcodec); - return codec && (codec->cb_type == FF_CODEC_CB_TYPE_DECODE || - codec->cb_type == FF_CODEC_CB_TYPE_DECODE_SUB || - codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME); + return codec && codec->is_decoder; } int ff_set_dimensions(AVCodecContext *s, int width, int height) |