https://github.com/MaartenBaert/ssr/issues/1090 https://github.com/MaartenBaert/ssr/pull/1092 --- a/src/AV/AVWrapper.cpp +++ b/src/AV/AVWrapper.cpp @@ -147,3 +147,9 @@ bool AVCodecSupportsPixelFormat(const AVCodec* codec, AVPixelFormat pixel_fmt) { +#if SSR_USE_AVCODEC_GET_SUPPORTED_CONFIG + const AVPixelFormat *p = NULL; + if(avcodec_get_supported_config(NULL, codec, AV_CODEC_CONFIG_PIX_FORMAT, 0, (const void**) &p, NULL) < 0) + return true; // the query failed, assume it is supported +#else const AVPixelFormat *p = codec->pix_fmts; +#endif if(p == NULL) @@ -159,3 +165,9 @@ bool AVCodecSupportsSampleFormat(const AVCodec* codec, AVSampleFormat sample_fmt) { +#if SSR_USE_AVCODEC_GET_SUPPORTED_CONFIG + const AVSampleFormat *p = NULL; + if(avcodec_get_supported_config(NULL, codec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, (const void**) &p, NULL) < 0) + return true; // the query failed, assume it is supported +#else const AVSampleFormat *p = codec->sample_fmts; +#endif if(p == NULL) --- a/src/Global.h +++ b/src/Global.h @@ -284,2 +284,5 @@ +// avcodec_get_supported_config: lavc 61.13.100 / ??? +// AVCodec::pix_fmts and AVCodec::sample_fmts were deprecated at the same time and removed in lavc 63 +#define SSR_USE_AVCODEC_GET_SUPPORTED_CONFIG TEST_AV_VERSION(LIBAVCODEC, 61, 13, 999, 999) // avcodec_close deprecated: lavc 60.39.100 / ???