diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-07-14 18:26:43 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-07-20 20:47:46 +0200 |
commit | 411e1833601e542b28681feab23ef4754644eb47 (patch) | |
tree | 8544f81e4069b2da938c5bc57b8795670bb168d9 /fftools/opt_common.c | |
parent | 78699923ac8ab8c2de1ba64c464385a9e12258ed (diff) | |
download | ffmpeg-411e1833601e542b28681feab23ef4754644eb47.tar.gz |
fftools/opt_common: replace report_and_exit() with returning an error code
Remove report_and_exit(), as it has no more users.
Diffstat (limited to 'fftools/opt_common.c')
-rw-r--r-- | fftools/opt_common.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fftools/opt_common.c b/fftools/opt_common.c index 39258bb46c..913932c914 100644 --- a/fftools/opt_common.c +++ b/fftools/opt_common.c @@ -632,7 +632,7 @@ static int compare_codec_desc(const void *a, const void *b) strcmp((*da)->name, (*db)->name); } -static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs) +static int get_codecs_sorted(const AVCodecDescriptor ***rcodecs) { const AVCodecDescriptor *desc = NULL; const AVCodecDescriptor **codecs; @@ -641,7 +641,7 @@ static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs) while ((desc = avcodec_descriptor_next(desc))) nb_codecs++; if (!(codecs = av_calloc(nb_codecs, sizeof(*codecs)))) - report_and_exit(AVERROR(ENOMEM)); + return AVERROR(ENOMEM); desc = NULL; while ((desc = avcodec_descriptor_next(desc))) codecs[i++] = desc; @@ -666,7 +666,11 @@ static char get_media_type_char(enum AVMediaType type) int show_codecs(void *optctx, const char *opt, const char *arg) { const AVCodecDescriptor **codecs; - unsigned i, nb_codecs = get_codecs_sorted(&codecs); + unsigned i; + int nb_codecs = get_codecs_sorted(&codecs); + + if (nb_codecs < 0) + return nb_codecs; printf("Codecs:\n" " D..... = Decoding supported\n" |