From: François Cartegnie Date: Tue, 24 Sep 2024 11:43:08 +0000 (+0700) Subject: codec: x265: handle X265_MAX_FRAME_THREADS on newer CPU X-Git-Tag: archive/raspbian/3.0.21-6+rpi1^2~49 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7d26f65e12b72a644c9f891c9c2d9bebe56ee244;p=vlc.git codec: x265: handle X265_MAX_FRAME_THREADS on newer CPU libx265 will bail out when hitting the limit x265 [error]: frameNumThreads (--frame-threads) must be [0 .. X265_MAX_FRAME_THREADS) (cherry picked from commit bbd294d1e46b86653873ec88d49e9a15cbaae68f) Gbp-Pq: Name 0076-codec-x265-handle-X265_MAX_FRAME_THREADS-on-newer-CP.patch --- diff --git a/modules/codec/x265.c b/modules/codec/x265.c index 5585f2cb..2943ea6e 100644 --- a/modules/codec/x265.c +++ b/modules/codec/x265.c @@ -36,6 +36,10 @@ #include +#ifndef X265_MAX_FRAME_THREADS +# define X265_MAX_FRAME_THREADS 16 +#endif + /***************************************************************************** * Module descriptor *****************************************************************************/ @@ -156,6 +160,8 @@ static int Open (vlc_object_t *p_this) x265_param_default(param); param->frameNumThreads = vlc_GetCPUCount(); + if(param->frameNumThreads > X265_MAX_FRAME_THREADS) + param->frameNumThreads = X265_MAX_FRAME_THREADS; param->bEnableWavefront = 0; // buggy in x265, use frame threading for now param->maxCUSize = 16; /* use smaller macroblock */