<html><head></head><body>Hi,<br><br>Don't use the crappy (and name-unspaced) __MAX, this expands wrong. There's even a nanoscopic race here if the process affinity is changed concurrently.<br><br><div class="gmail_quote">Le 2 décembre 2020 13:09:08 GMT+02:00, Marvin Scholz <epirat07@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Without this limit, on a processor with many cores it would use<br>so many frame threads that it would fail picture pool allocation.<br><br>Fix #25190<hr> modules/codec/dav1d.c | 2 +-<br> 1 file changed, 1 insertion(+), 1 deletion(-)<br><br>diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c<br>index 3e44d524ed..9e7f233d1a 100644<br>--- a/modules/codec/dav1d.c<br>+++ b/modules/codec/dav1d.c<br>@@ -287,7 +287,7 @@ static int OpenDecoder(vlc_object_t *p_this)<br> p_sys->s.n_tile_threads = VLC_CLIP(vlc_GetCPUCount(), 1, 4);<br> p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");<br> if (p_sys->s.n_frame_threads == 0)<br>- p_sys->s.n_frame_threads = __MAX(1, vlc_GetCPUCount());<br>+ p_sys->s.n_frame_threads = __MIN(vlc_GetCPUCount(), 16);<br> p_sys->s.allocator.cookie = dec;<br> p_sys->s.allocator.alloc_picture_callback = NewPicture;<br> p_sys->s.allocator.release_picture_callback = FreePicture;</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>