freerdp/freerdp-2.10.0-ffmpeg-6.0.patch

43 lines
1.4 KiB
Diff

From aa2cb9aa5ff5562433598ba168a466e0752bca0e Mon Sep 17 00:00:00 2001
From: akallabeth <akallabeth@posteo.net>
Date: Tue, 14 Feb 2023 07:48:54 +0100
Subject: [PATCH] Fixed #8686: Update h264 to use new FFMPEG API
---
channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 2 ++
libfreerdp/codec/h264_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 339462d865f..beea80b7a1e 100644
--- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
+++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
@@ -239,8 +239,10 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYP
}
}
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 18, 100)
if (mdecoder->codec->capabilities & AV_CODEC_CAP_TRUNCATED)
mdecoder->codec_context->flags |= AV_CODEC_FLAG_TRUNCATED;
+#endif
return TRUE;
}
diff --git a/libfreerdp/codec/h264_ffmpeg.c b/libfreerdp/codec/h264_ffmpeg.c
index 8a23db2473c..896a333019b 100644
--- a/libfreerdp/codec/h264_ffmpeg.c
+++ b/libfreerdp/codec/h264_ffmpeg.c
@@ -615,10 +615,12 @@ static BOOL libavcodec_init(H264_CONTEXT* h264)
goto EXCEPTION;
}
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 18, 100)
if (sys->codecDecoder->capabilities & AV_CODEC_CAP_TRUNCATED)
{
sys->codecDecoderContext->flags |= AV_CODEC_FLAG_TRUNCATED;
}
+#endif
#ifdef WITH_VAAPI