[vlc-commits] codec: dav1d: do not use VLC_CLIP

Marvin Scholz git at videolan.org
Fri Apr 23 01:31:00 UTC 2021


vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Apr  6 12:00:01 2021 +0200| [4a583d606aa2c12c12d2d176f9e0609b6ffd2421] | committer: Marvin Scholz

codec: dav1d: do not use VLC_CLIP

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=4a583d606aa2c12c12d2d176f9e0609b6ffd2421
---

 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;



More information about the vlc-commits mailing list