From cd784644f5e82b9988043f229c19603289c6d32c Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 29 Nov 2023 20:07:10 +0900 Subject: [PATCH] libobs: Fence off unnecessary code due to FFmpeg v6.1 changes Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to allow builds for using older versions of FFmpeg. This commit prevents obs from using the "fenced" code if using FFmpeg 6.1, since in FFmpeg commit [1] the "side_data" is added to `AVCodecParameters`, and therefore the existing/following `avcodec_parameters_copy(...)` will account for the metadata. [1]: avcodec/codec_par: add side data to AVCodecParameters https://github.com/FFmpeg/FFmpeg/commit/21d7cc6fa9a26e94965fa71b25655d07568450fe --- libobs/media-io/media-remux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libobs/media-io/media-remux.c b/libobs/media-io/media-remux.c index 7d5eead20..827d4e59b 100644 --- a/libobs/media-io/media-remux.c +++ b/libobs/media-io/media-remux.c @@ -91,6 +91,7 @@ static inline bool init_output(media_remux_job_t job, const char *out_filename) return false; } +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102) #if FF_API_BUFFER_SIZE_T int content_size; #else @@ -125,6 +126,7 @@ static inline bool init_output(media_remux_job_t job, const char *out_filename) mastering_size); } } +#endif ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar);