History

avcodec/codec_internal: Add inlined version of av_codec_is_(de|en)coder

These functions check whether the AVCodec* is NULL, but this has already been checked at a lot of places in our codebase, so that it boils down to checking the is_decoder flag.

Andreas Rheinhardt committed 1 year ago

Commit c8be3091 parent 47d7c6c6 files · +40 −20Browse files

Showing the changes to libavcodec/allcodecs.c (1 of 6 files). Show all

Unified · Split

libavcodec/allcodecs.c+4−4
@@ -1013,12 +1013,12 @@ static const AVCodec *find_codec(enum AVCodecID id, int (*x)(const AVCodec *)) · 1012 unmodified lines
1013 1013
1014const AVCodec *avcodec_find_encoder(enum AVCodecID id)1014const AVCodec *avcodec_find_encoder(enum AVCodecID id)
1015{1015{
1016 return find_codec(id, av_codec_is_encoder);1016 return find_codec(id, ff_codec_is_encoder);
1017}1017}
1018 1018
1019const AVCodec *avcodec_find_decoder(enum AVCodecID id)1019const AVCodec *avcodec_find_decoder(enum AVCodecID id)
1020{1020{
1021 return find_codec(id, av_codec_is_decoder);1021 return find_codec(id, ff_codec_is_decoder);
1022}1022}
1023 1023
1024static const AVCodec *find_codec_by_name(const char *name, int (*x)(const AVCodec *))1024static const AVCodec *find_codec_by_name(const char *name, int (*x)(const AVCodec *))
@@ -1041,10 +1041,10 @@ static const AVCodec *find_codec_by_name(const char *name, int (*x)(const AVCode · 16 unmodified lines
1041 1041
1042const AVCodec *avcodec_find_encoder_by_name(const char *name)1042const AVCodec *avcodec_find_encoder_by_name(const char *name)
1043{1043{
1044 return find_codec_by_name(name, av_codec_is_encoder);1044 return find_codec_by_name(name, ff_codec_is_encoder);
1045}1045}
1046 1046
1047const AVCodec *avcodec_find_decoder_by_name(const char *name)1047const AVCodec *avcodec_find_decoder_by_name(const char *name)
1048{1048{
1049 return find_codec_by_name(name, av_codec_is_decoder);1049 return find_codec_by_name(name, ff_codec_is_decoder);
1050}1050}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t