浏览代码

linux-v4l2: Fix deprecation with FFmpeg 7

FFmpeg 7 header states that avcodec_close should not be used since
avcodev_free_context already close the context.
tytan652 1 年之前
父节点
当前提交
7d4501131a
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      plugins/linux-v4l2/v4l2-decoder.c

+ 2 - 0
plugins/linux-v4l2/v4l2-decoder.c

@@ -78,7 +78,9 @@ void v4l2_destroy_decoder(struct v4l2_decoder *decoder)
 	}
 
 	if (decoder->context) {
+#if LIBAVCODEC_VERSION_MAJOR < 61
 		avcodec_close(decoder->context);
+#endif
 		avcodec_free_context(&decoder->context);
 	}
 }