[vlc-devel] [PATCH 2/3] nvdec: remove now-useless loop on out chromas

quentin.chateau at deepskycorp.com quentin.chateau at deepskycorp.com
Thu Mar 19 17:42:10 CET 2020


From: Quentin Chateau <quentin.chateau at deepskycorp.com>

---
 modules/hw/nvdec/nvdec.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
index 9ee61e8c5e..c35af05253 100644
--- a/modules/hw/nvdec/nvdec.c
+++ b/modules/hw/nvdec/nvdec.c
@@ -855,24 +855,14 @@ static int OpenDecoder(vlc_object_t *p_this)
         goto error;
     }
 
-    vlc_fourcc_t output_chromas[2];
-    size_t chroma_idx = 0;
-    output_chromas[chroma_idx++] = MapSurfaceChroma(cudaChroma, i_depth_luma);
-    output_chromas[chroma_idx++] = 0;
-
-    for (chroma_idx = 0; output_chromas[chroma_idx] != 0; chroma_idx++)
+    p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma =
+        MapSurfaceChroma(cudaChroma, i_depth_luma);
+    result = decoder_UpdateVideoOutput(p_dec, p_sys->vctx_out);
+    if (result != VLC_SUCCESS)
     {
-        p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma = output_chromas[chroma_idx];
-        result = decoder_UpdateVideoOutput(p_dec, p_sys->vctx_out);
-        if (result == VLC_SUCCESS)
-        {
-            msg_Dbg(p_dec, "using chroma %4.4s", (char*)&p_dec->fmt_out.video.i_chroma);
-            break;
-        }
         msg_Warn(p_dec, "Failed to use output chroma %4.4s", (char*)&p_dec->fmt_out.video.i_chroma);
-    }
-    if (result != VLC_SUCCESS)
         goto error;
+    }
 
     int deinterlace_mode    = var_InheritInteger(p_dec, "nvdec-deint");
     if (deinterlace_mode <= 0)
-- 
2.17.1



More information about the vlc-devel mailing list