[vlc-devel] [VLC 3.x 2/2] codec: dav1d: do not use VLC_CLIP
Marvin Scholz
epirat07 at gmail.com
Tue Apr 6 12:01:44 UTC 2021
---
modules/codec/dav1d.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index 0498492a73..7994a4b516 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -285,7 +285,10 @@ static int OpenDecoder(vlc_object_t *p_this)
dav1d_default_settings(&p_sys->s);
p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
if (p_sys->s.n_tile_threads == 0)
- p_sys->s.n_tile_threads = VLC_CLIP(vlc_GetCPUCount(), 1, 4);
+ p_sys->s.n_tile_threads =
+ (i_core_count > 4) ? 4 :
+ (i_core_count > 1) ? i_core_count :
+ 1;
p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
if (p_sys->s.n_frame_threads == 0)
p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
--
2.30.1
More information about the vlc-devel
mailing list