X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cmdutils.c;h=2349b7052e49b361c29150328db400c6dd890198;hb=179655b6c6f27cca2089844046bc5f280bb83814;hp=7e652a1e7f9fb81e8bc86d8c485fc79ba25d74b0;hpb=458b062d61a92d725cde9363941747a1c6d1e575;p=ffmpeg diff --git a/cmdutils.c b/cmdutils.c index 7e652a1e7f9..2349b7052e4 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -292,17 +292,11 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags) void print_error(const char *filename, int err) { char errbuf[128]; + const char *errbuf_ptr = errbuf; - switch(err) { -#if CONFIG_NETWORK - case AVERROR(FF_NETERROR(EPROTONOSUPPORT)): - fprintf(stderr, "%s: Unsupported network protocol\n", filename); - break; -#endif - default: - av_strerror(err, errbuf, sizeof(errbuf)); - fprintf(stderr, "%s: %s\n", filename, errbuf); - } + if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) + errbuf_ptr = strerror(AVUNERROR(err)); + fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); } #define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent) \ @@ -615,6 +609,11 @@ void show_pix_fmts(void) "FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL\n" "-----\n"); +#if !CONFIG_SWSCALE +# define sws_isSupportedInput(x) 0 +# define sws_isSupportedOutput(x) 0 +#endif + for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) { const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt]; printf("%c%c%c%c%c %-16s %d %2d\n", @@ -642,7 +641,7 @@ int read_yesno(void) int read_file(const char *filename, char **bufptr, size_t *size) { - FILE *f = fopen(filename, "r"); + FILE *f = fopen(filename, "rb"); if (!f) { fprintf(stderr, "Cannot read file '%s': %s\n", filename, strerror(errno));