From d0488f86927ea7860c3e89b5745f66c9504a8d22 Mon Sep 17 00:00:00 2001 From: David Runge Date: Mon, 24 Jan 2022 19:47:29 +0100 Subject: [PATCH] Guard avcodec_register_all() calls {channels/tsmf/client/ffmpeg/tsmf,libfreerdp/codec/dsp}_ffmpeg.c: Guard calls to `avcodec_register_all()` against use beyond `AV_VERSION_INT(58, 10, 100)`, where upstream ffmpeg made it obsolete. --- channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 2 ++ libfreerdp/codec/dsp_ffmpeg.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c index 0444ad07b..cf0aa9ba1 100644 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c @@ -615,7 +615,9 @@ static void tsmf_ffmpeg_free(ITSMFDecoder* decoder) static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT; static BOOL CALLBACK InitializeAvCodecs(PINIT_ONCE once, PVOID param, PVOID* context) { +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100) avcodec_register_all(); +#endif return TRUE; } diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c index db7450b7a..37c67da79 100644 --- a/libfreerdp/codec/dsp_ffmpeg.c +++ b/libfreerdp/codec/dsp_ffmpeg.c @@ -573,7 +573,9 @@ BOOL freerdp_dsp_ffmpeg_supports_format(const AUDIO_FORMAT* format, BOOL encode) FREERDP_DSP_CONTEXT* freerdp_dsp_ffmpeg_context_new(BOOL encode) { FREERDP_DSP_CONTEXT* context; +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100) avcodec_register_all(); +#endif context = calloc(1, sizeof(FREERDP_DSP_CONTEXT)); if (!context)