[vlc-devel] [PATCH v2 2/5] dav1d: allow the hardware decoding to force the number of threads

Steve Lhomme robux4 at ycbcr.xyz
Fri Sep 11 11:46:06 CEST 2020


DXVA should use only one thread to feed the frames.
---
 modules/codec/dav1d.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index 539780b0d83..e8e030cd7ca 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -402,11 +402,7 @@ 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_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
-    if (p_sys->s.n_frame_threads == 0)
-        p_sys->s.n_frame_threads = __MAX(1, vlc_GetCPUCount());
     p_sys->s.allocator.cookie = dec;
     p_sys->s.allocator.alloc_picture_callback = NewPicture;
     p_sys->s.allocator.release_picture_callback = FreePicture;
@@ -451,6 +447,11 @@ static int OpenDecoder(vlc_object_t *p_this)
     dec->fmt_out.video.i_visible_width  = dec->fmt_out.video.i_width;
     dec->fmt_out.video.i_visible_height = dec->fmt_out.video.i_height;
 
+    if (p_sys->s.n_tile_threads == 0)
+        p_sys->s.n_tile_threads = VLC_CLIP(vlc_GetCPUCount(), 1, 4);
+    if (p_sys->s.n_frame_threads == 0)
+        p_sys->s.n_frame_threads = __MAX(1, vlc_GetCPUCount());
+
     if (dav1d_open(&p_sys->c, &p_sys->s) < 0)
     {
         msg_Err(p_this, "Could not open the Dav1d decoder");
-- 
2.26.2



More information about the vlc-devel mailing list