Skip to content

Commit

Permalink
graphics/blender: Fix compatibility with FFmpeg 6.0
Browse files Browse the repository at this point in the history
Fix build with FFmpeg 6.0

Source:
https://github.com/archlinux/svntogit-community/blob/master/blender/trunk/blender-ffmpeg6.patch

PR:		270275
Reviewed by:	Shane Ambler <FreeBSD@ShaneWare.Biz> (maintainer)
  • Loading branch information
Daniel Engberg authored and Daniel Engberg committed Mar 25, 2023
1 parent b9257f4 commit 0ed9c88
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
@@ -0,0 +1,11 @@
--- source/blender/blenkernel/intern/writeffmpeg.c.orig 2022-11-08 13:50:16 UTC
+++ source/blender/blenkernel/intern/writeffmpeg.c
@@ -855,7 +855,7 @@ static AVStream *alloc_video_stream(FFMpegContext *con
255);
st->avg_frame_rate = av_inv_q(c->time_base);

- if (codec->capabilities & AV_CODEC_CAP_AUTO_THREADS) {
+ if (codec->capabilities & AV_CODEC_CAP_OTHER_THREADS) {
c->thread_count = 0;
}
else {
@@ -0,0 +1,11 @@
--- source/blender/imbuf/intern/anim_movie.c.orig 2022-11-04 00:33:07 UTC
+++ source/blender/imbuf/intern/anim_movie.c
@@ -554,7 +554,7 @@ static int startffmpeg(struct anim *anim)
avcodec_parameters_to_context(pCodecCtx, video_stream->codecpar);
pCodecCtx->workaround_bugs = FF_BUG_AUTODETECT;

- if (pCodec->capabilities & AV_CODEC_CAP_AUTO_THREADS) {
+ if (pCodec->capabilities & AV_CODEC_CAP_OTHER_THREADS) {
pCodecCtx->thread_count = 0;
}
else {
20 changes: 20 additions & 0 deletions graphics/blender/files/patch-source_blender_imbuf_intern_indexer.c
@@ -0,0 +1,20 @@
--- source/blender/imbuf/intern/indexer.c.orig 2022-11-04 00:33:07 UTC
+++ source/blender/imbuf/intern/indexer.c
@@ -559,7 +559,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffm
av_dict_set(&codec_opts, "preset", "veryfast", 0);
av_dict_set(&codec_opts, "tune", "fastdecode", 0);

- if (rv->codec->capabilities & AV_CODEC_CAP_AUTO_THREADS) {
+ if (rv->codec->capabilities & AV_CODEC_CAP_OTHER_THREADS) {
rv->c->thread_count = 0;
}
else {
@@ -872,7 +872,7 @@ static IndexBuildContext *index_ffmpeg_create_context(
avcodec_parameters_to_context(context->iCodecCtx, context->iStream->codecpar);
context->iCodecCtx->workaround_bugs = FF_BUG_AUTODETECT;

- if (context->iCodec->capabilities & AV_CODEC_CAP_AUTO_THREADS) {
+ if (context->iCodec->capabilities & AV_CODEC_CAP_OTHER_THREADS) {
context->iCodecCtx->thread_count = 0;
}
else {

0 comments on commit 0ed9c88

Please sign in to comment.