[vlc-devel] [PATCH 04/10] vout: move the deinterlacing control call in video_output.c

Steve Lhomme robux4 at ycbcr.xyz
Thu Jul 16 15:58:02 CEST 2020


So that only video_output.c needs to know about its internal control.
---
 src/video_output/interlacing.c   | 7 +------
 src/video_output/video_output.c  | 6 ++++++
 src/video_output/vout_internal.h | 1 +
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/video_output/interlacing.c b/src/video_output/interlacing.c
index 3192b3a9cfe..01c87a80eba 100644
--- a/src/video_output/interlacing.c
+++ b/src/video_output/interlacing.c
@@ -82,12 +82,7 @@ static int DeinterlaceCallback(vlc_object_t *object, char const *cmd,
     var_SetString(vout, "sout-deinterlace-mode", mode);
 
     msg_Dbg(vout, "deinterlace %d, mode %s, is_needed %d", deinterlace_state, mode, is_needed);
-    if (deinterlace_state == 0 || (deinterlace_state < 0 && !is_needed))
-        vout_control_PushBool(&vout->p->control,
-                              VOUT_CONTROL_CHANGE_INTERLACE, false);
-    else
-        vout_control_PushBool(&vout->p->control,
-                              VOUT_CONTROL_CHANGE_INTERLACE, true);
+    vout_ControlChangeInterlacing(vout, deinterlace_state != 0 && (is_needed || deinterlace_state >= 0));
 
     /* */
     free(old);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 288f273e613..4c209ff2924 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -598,6 +598,12 @@ void vout_ControlChangeFilters(vout_thread_t *vout, const char *filters)
                             filters);
 }
 
+void vout_ControlChangeInterlacing(vout_thread_t *vout, bool set)
+{
+    assert(!vout->p->dummy);
+    vout_control_PushBool(&vout->p->control, VOUT_CONTROL_CHANGE_INTERLACE, set);
+}
+
 void vout_ControlChangeSubSources(vout_thread_t *vout, const char *filters)
 {
     assert(!vout->p->dummy);
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 6529c9846be..abeb4c24e57 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -251,6 +251,7 @@ void vout_ChangeCropRatio(vout_thread_t *, unsigned num, unsigned den);
 void vout_ChangeCropWindow(vout_thread_t *, int x, int y, int width, int height);
 void vout_ChangeCropBorder(vout_thread_t *, int left, int top, int right, int bottom);
 void vout_ControlChangeFilters(vout_thread_t *, const char *);
+void vout_ControlChangeInterlacing(vout_thread_t *, bool);
 void vout_ControlChangeSubSources(vout_thread_t *, const char *);
 void vout_ControlChangeSubFilters(vout_thread_t *, const char *);
 void vout_ChangeSpuChannelMargin(vout_thread_t *, enum vlc_vout_order order, int);
-- 
2.26.2



More information about the vlc-devel mailing list