From 0d080d1a07a26055796b0ea5b7095a01dec9fee0 Mon Sep 17 00:00:00 2001 From: Timo Gurr Date: Thu, 2 Mar 2023 15:12:35 +0100 Subject: [PATCH 1/2] Fix: Build with FFmpeg 6.0 Pull Request #105377 --- intern/ffmpeg/ffmpeg_compat.h | 11 +++++++++++ source/blender/blenkernel/intern/writeffmpeg.c | 2 +- source/blender/imbuf/intern/anim_movie.c | 2 +- source/blender/imbuf/intern/indexer.c | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index f7d87af8bca..f121b400f07 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -44,6 +44,17 @@ # define FFMPEG_USE_OLD_CHANNEL_VARS #endif +/* AV_CODEC_CAP_AUTO_THREADS was renamed to AV_CODEC_CAP_OTHER_THREADS with + * upstream commit + * github.com/FFmpeg/FFmpeg/commit/7d09579190def3ef7562399489e628f3b65714ce + * (lavc 58.132.100) and removed with commit + * github.com/FFmpeg/FFmpeg/commit/10c9a0874cb361336237557391d306d26d43f137 + * for ffmpeg 6.0. + */ +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,132,100) +# define AV_CODEC_CAP_OTHER_THREADS AV_CODEC_CAP_AUTO_THREADS +#endif + #if (LIBAVFORMAT_VERSION_MAJOR < 58) || \ ((LIBAVFORMAT_VERSION_MAJOR == 58) && (LIBAVFORMAT_VERSION_MINOR < 76)) # define FFMPEG_USE_DURATION_WORKAROUND 1 diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 6d5bacdb2d2..89b3589753f 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -863,7 +863,7 @@ static AVStream *alloc_video_stream(FFMpegContext *context, 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 { diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index a6edcc5977e..32c64cfd095 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/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 { diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 6d849f54d4c..2936f9758c0 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -559,7 +559,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( 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(struct anim *anim, 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 { From 89c3ead7c6d859674ba5165ecb3fa9bd6136c622 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 3 Mar 2023 23:17:20 +0100 Subject: [PATCH 2/2] Fix #105388: Default Font Accidentally Kerning Move the code that disables kerning for the default font so it can't be re-enabled by the cache subsystem. Pull Request #105415 --- source/blender/blenfont/intern/blf.c | 7 ------- source/blender/blenfont/intern/blf_font.c | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index a8cbb89c7ad..b6f7bb5a066 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -163,13 +163,6 @@ int BLF_load_unique(const char *name) FontBLF *font = blf_font_new(name, filepath); - /* XXX: Temporarily disable kerning in our main font. Kerning had been accidentally removed from - * our font in 3.1. In 3.4 we disable kerning here in the new version to keep spacing the same - * (#101506). Enable again later with change of font, placement, or rendering - Harley. */ - if (font && BLI_str_endswith(filepath, BLF_DEFAULT_PROPORTIONAL_FONT)) { - font->face_flags &= ~FT_FACE_FLAG_KERNING; - } - MEM_freeN(filepath); if (!font) { diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 2c877ecb41d..226ad9e6cc3 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -1430,6 +1430,14 @@ bool blf_ensure_face(FontBLF *font) font->face_flags = font->face->face_flags; + /* XXX: Temporarily disable kerning in our main font. Kerning had been accidentally removed + * from our font in 3.1. In 3.4 we disable kerning here in the new version to keep spacing the + * same + * (#101506). Enable again later with change of font, placement, or rendering - Harley. */ + if (font && font->filepath && BLI_str_endswith(font->filepath, BLF_DEFAULT_PROPORTIONAL_FONT)) { + font->face_flags &= ~FT_FACE_FLAG_KERNING; + } + if (FT_HAS_MULTIPLE_MASTERS(font)) { FT_Get_MM_Var(font->face, &(font->variations)); }