瀏覽代碼

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
Stephen Seo 1 年之前
父節點
當前提交
cd784644f5
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      libobs/media-io/media-remux.c

+ 2 - 0
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);