File guacamole-server_ffmpeg.patch of Package guacamole-server
From 7124e285461952b52274e1c2dfe69cbeff98f1de Mon Sep 17 00:00:00 2001
From: Dan Fandrich <dan@coneharvesters.com>
Date: Sat, 19 Mar 2022 23:15:36 -0700
Subject: [PATCH] Adapt to const parameters of ffmpeg 5.0
---
src/guacenc/ffmpeg-compat.c | 4 ++--
src/guacenc/ffmpeg-compat.h | 4 ++--
src/guacenc/video.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/guacenc/ffmpeg-compat.c b/src/guacenc/ffmpeg-compat.c
index 54e4b7498..2412e4817 100644
--- a/src/guacenc/ffmpeg-compat.c
+++ b/src/guacenc/ffmpeg-compat.c
@@ -213,7 +213,7 @@ int guacenc_avcodec_encode_video(guacenc_video* video, AVFrame* frame) {
#endif
}
-AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
+AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, const AVCodec* codec,
int bitrate, int width, int height, int gop_size, int qmax, int qmin,
int pix_fmt, AVRational time_base) {
@@ -249,7 +249,7 @@ AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
}
int guacenc_open_avcodec(AVCodecContext *avcodec_context,
- AVCodec *codec, AVDictionary **options,
+ const AVCodec *codec, AVDictionary **options,
AVStream* stream) {
int ret = avcodec_open2(avcodec_context, codec, options);
diff --git a/src/guacenc/ffmpeg-compat.h b/src/guacenc/ffmpeg-compat.h
index a5cfb2f59..d75b5d74e 100644
--- a/src/guacenc/ffmpeg-compat.h
+++ b/src/guacenc/ffmpeg-compat.h
@@ -128,7 +128,7 @@ int guacenc_avcodec_encode_video(guacenc_video* video, AVFrame* frame);
* The pointer to the configured AVCodecContext.
*
*/
-AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
+AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, const AVCodec* codec,
int bitrate, int width, int height, int gop_size, int qmax, int qmin,
int pix_fmt, AVRational time_base);
@@ -158,7 +158,7 @@ AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
* Zero on success, a negative value on error.
*/
int guacenc_open_avcodec(AVCodecContext *avcodec_context,
- AVCodec *codec, AVDictionary **options,
+ const AVCodec *codec, AVDictionary **options,
AVStream* stream);
#endif
diff --git a/src/guacenc/video.c b/src/guacenc/video.c
index e2eed51f3..c8fb8b993 100644
--- a/src/guacenc/video.c
+++ b/src/guacenc/video.c
@@ -47,7 +47,7 @@
guacenc_video* guacenc_video_alloc(const char* path, const char* codec_name,
int width, int height, int bitrate) {
- AVOutputFormat *container_format;
+ const AVOutputFormat *container_format;
AVFormatContext *container_format_context;
AVStream *video_stream;
int ret;
@@ -63,7 +63,7 @@ guacenc_video* guacenc_video_alloc(const char* path, const char* codec_name,
container_format = container_format_context->oformat;
/* Pull codec based on name */
- AVCodec* codec = avcodec_find_encoder_by_name(codec_name);
+ const AVCodec* codec = avcodec_find_encoder_by_name(codec_name);
if (codec == NULL) {
guacenc_log(GUAC_LOG_ERROR, "Failed to locate codec \"%s\".",
codec_name);