X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Futils.c;h=5df4d18b6b29095fa474224939f276cc48151f51;hb=37d3e0667abd01124d783f3ca10a4aef05746a2a;hp=cf406817596ad9febd4a5ec889d51ada9adbc944;hpb=ae4ffe9f643bb9f0d5f158dca39c468dd5994adf;p=ffmpeg diff --git a/libavcodec/utils.c b/libavcodec/utils.c index cf406817596..5df4d18b6b2 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -79,7 +79,7 @@ void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size) } /* encoder management */ -AVCodec *first_avcodec = NULL; +static AVCodec *first_avcodec = NULL; AVCodec *av_codec_next(AVCodec *c){ if(c) return c->next; @@ -711,7 +711,6 @@ static const AVOption options[]={ {"dct8x8", "high profile 8x8 transform (H.264)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_8X8DCT, INT_MIN, INT_MAX, V|E, "flags2"}, {"fastpskip", "fast pskip (H.264)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_FASTPSKIP, INT_MIN, INT_MAX, V|E, "flags2"}, {"aud", "access unit delimiters (H.264)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_AUD, INT_MIN, INT_MAX, V|E, "flags2"}, -{"brdo", "b-frame rate-distortion optimization", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_BRDO, INT_MIN, INT_MAX, V|E, "flags2"}, {"skiprd", "RD optimal MB level residual skipping", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_SKIP_RD, INT_MIN, INT_MAX, V|E, "flags2"}, {"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), FF_OPT_TYPE_FLOAT, 20.0, FLT_MIN, FLT_MAX, V|E}, {"deblockalpha", "in-loop deblocking filter alphac0 parameter", OFFSET(deblockalpha), FF_OPT_TYPE_INT, DEFAULT, -6, 6, V|E}, @@ -1010,6 +1009,8 @@ AVCodec *avcodec_find_encoder(enum CodecID id) AVCodec *avcodec_find_encoder_by_name(const char *name) { AVCodec *p; + if (!name) + return NULL; p = first_avcodec; while (p) { if (p->encode != NULL && strcmp(name,p->name) == 0) @@ -1034,6 +1035,8 @@ AVCodec *avcodec_find_decoder(enum CodecID id) AVCodec *avcodec_find_decoder_by_name(const char *name) { AVCodec *p; + if (!name) + return NULL; p = first_avcodec; while (p) { if (p->decode != NULL && strcmp(name,p->name) == 0) @@ -1452,7 +1455,7 @@ static const VideoFrameRateAbbr video_frame_rate_abbrs[]= { int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str) { int i; - int n = sizeof(video_frame_size_abbrs) / sizeof(VideoFrameSizeAbbr); + int n = FF_ARRAY_ELEMS(video_frame_size_abbrs); const char *p; int frame_width = 0, frame_height = 0; @@ -1480,7 +1483,7 @@ int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str) int av_parse_video_frame_rate(AVRational *frame_rate, const char *arg) { int i; - int n = sizeof(video_frame_rate_abbrs) / sizeof(VideoFrameRateAbbr); + int n = FF_ARRAY_ELEMS(video_frame_rate_abbrs); char* cp; /* First, we check our abbreviation table */