[vlc-devel] [PATCH v4 11/23] video_output: always use interlacing.has_deint when creating filters

Steve Lhomme robux4 at ycbcr.xyz
Fri Aug 21 11:59:29 CEST 2020


If the value changed, just set it to the newest value.
---
 src/video_output/video_output.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 60bfbd7759e..304d3c049e5 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -927,8 +927,7 @@ typedef struct {
     config_chain_t *cfg;
 } vout_filter_t;
 
-static void ThreadChangeFilters(vout_thread_sys_t *vout,
-                                const bool *new_deinterlace)
+static void ThreadChangeFilters(vout_thread_sys_t *vout)
 {
     vout_thread_sys_t *sys = vout;
     ThreadFilterFlush(vout, true);
@@ -940,9 +939,6 @@ static void ThreadChangeFilters(vout_thread_sys_t *vout,
     vlc_array_init(&array_static);
     vlc_array_init(&array_interactive);
 
-    if (new_deinterlace != NULL)
-        sys->private.interlacing.has_deint = *new_deinterlace;
-
     if (sys->private.interlacing.has_deint)
     {
         vout_filter_t *e = malloc(sizeof(*e));
@@ -1104,7 +1100,7 @@ static int ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reuse,
                         vlc_video_context_Release(sys->filter.src_vctx);
                     sys->filter.src_vctx = pic_vctx ? vlc_video_context_Hold(pic_vctx) : NULL;
 
-                    ThreadChangeFilters(vout, NULL);
+                    ThreadChangeFilters(vout);
                 }
             }
         }
@@ -1453,7 +1449,8 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     if (sys->filter.changed ||
         sys->private.interlacing.has_deint != sys->filter.new_interlaced)
     {
-        ThreadChangeFilters(vout, &sys->filter.new_interlaced);
+        sys->private.interlacing.has_deint = sys->filter.new_interlaced;
+        ThreadChangeFilters(vout);
     }
     vlc_mutex_unlock(&sys->filter.lock);
 
-- 
2.26.2



More information about the vlc-devel mailing list