[vlc-devel] [PATCH 2/2] video_output/interlacing: tell interlace state when creating/updating filters

Steve Lhomme robux4 at ycbcr.xyz
Mon Nov 16 10:06:50 CET 2020


No need for an intermediate variable for that.

Now vout_thread_interlacing_t has variables exclusively used in interlacing.c.
---
 src/video_output/interlacing.c  | 2 --
 src/video_output/video_output.c | 8 +++-----
 src/video_output/vout_private.h | 1 -
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/video_output/interlacing.c b/src/video_output/interlacing.c
index 88af7e93fa5..dd7dffc611c 100644
--- a/src/video_output/interlacing.c
+++ b/src/video_output/interlacing.c
@@ -109,8 +109,6 @@ void vout_InitInterlacingSupport(vout_thread_t *vout)
 
     msg_Dbg(vout, "Deinterlacing available");
 
-    sys->has_deint = false;
-
     /* Create the configuration variables */
     /* */
     var_Create(vout, "deinterlace", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index cf5ebc308a8..89b5241dc7d 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -954,7 +954,7 @@ typedef struct {
     config_chain_t *cfg;
 } vout_filter_t;
 
-static void ThreadChangeFilters(vout_thread_sys_t *vout, bool flush_displayed)
+static void ThreadChangeFilters(vout_thread_sys_t *vout, bool interlace, bool flush_displayed)
 {
     vout_thread_sys_t *sys = vout;
     ThreadFilterFlush(vout, true, flush_displayed);
@@ -966,7 +966,7 @@ static void ThreadChangeFilters(vout_thread_sys_t *vout, bool flush_displayed)
     vlc_array_init(&array_static);
     vlc_array_init(&array_interactive);
 
-    if (sys->obj.interlacing.has_deint)
+    if (interlace)
     {
         vout_filter_t *e = malloc(sizeof(*e));
 
@@ -1103,9 +1103,7 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
                         vlc_video_context_Release(sys->filter.src_vctx);
                     sys->filter.src_vctx = pic_vctx ? vlc_video_context_Hold(pic_vctx) : NULL;
 
-                    sys->obj.interlacing.has_deint = sys->filter.new_interlaced;
-
-                    ThreadChangeFilters(vout, can_flush);
+                    ThreadChangeFilters(vout, sys->filter.new_interlaced, can_flush);
                 }
 
                 const vlc_tick_t system_now = vlc_tick_now();
diff --git a/src/video_output/vout_private.h b/src/video_output/vout_private.h
index 8befd1bbaf3..471981ffde3 100644
--- a/src/video_output/vout_private.h
+++ b/src/video_output/vout_private.h
@@ -32,7 +32,6 @@ typedef struct vout_thread_private_t vout_thread_private_t;
 
 typedef struct {
     bool        is_interlaced; // is the source interlaced
-    bool        has_deint;     // is deinterlacing filter needed
     vlc_tick_t  date;          // system date when interlacing source was last seen
 } vout_thread_interlacing_t;
 
-- 
2.26.2



More information about the vlc-devel mailing list