[vlc-commits] video_output: use filter lock to change deinterlacing in the vout thread

Steve Lhomme git at videolan.org
Tue Sep 15 12:24:44 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Aug 17 10:20:31 2020 +0200| [788a309f1cd57275149eab7dde2751910ae083cb] | committer: Steve Lhomme

video_output: use filter lock to change deinterlacing in the vout thread

We don't use the control lock anymore (from vout_control_PushBool), just the
filters lock.

Now the interlacing mode change is applied in frame by frame mode.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=788a309f1cd57275149eab7dde2751910ae083cb
---

 src/video_output/control.h      |  1 -
 src/video_output/video_output.c | 13 +++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/video_output/control.h b/src/video_output/control.h
index ed4613d6c1..91819d0b32 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -28,7 +28,6 @@
 /* */
 enum {
     VOUT_CONTROL_TERMINATE,
-    VOUT_CONTROL_CHANGE_INTERLACE,      /* boolean */
 
     VOUT_CONTROL_MOUSE_STATE,           /* vlc_mouse_t */
 };
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 5a906f6250..a0852dcd7d 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -173,6 +173,7 @@ typedef struct vout_thread_sys_t
     struct {
         vlc_mutex_t     lock;
         bool            changed;
+        bool            new_interlaced;
         char            *new_filters;
         char            *configuration;
         video_format_t    src_fmt;
@@ -795,7 +796,9 @@ void vout_ControlChangeInterlacing(vout_thread_t *vout, bool set)
 {
     vout_thread_sys_t *sys = VOUT_THREAD_TO_SYS(vout);
     assert(!sys->dummy);
-    vout_control_PushBool(&sys->control, VOUT_CONTROL_CHANGE_INTERLACE, set);
+    vlc_mutex_lock(&sys->filter.lock);
+    sys->filter.new_interlaced = set;
+    vlc_mutex_unlock(&sys->filter.lock);
 }
 
 void vout_ControlChangeSubSources(vout_thread_t *vout, const char *filters)
@@ -1493,9 +1496,10 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     assert(sys->clock);
 
     vlc_mutex_lock(&sys->filter.lock);
-    if (sys->filter.changed)
+    if (sys->filter.changed ||
+        sys->private.interlacing.has_deint != sys->filter.new_interlaced)
     {
-        ThreadChangeFilters(vout, sys->filter.new_filters, NULL, true);
+        ThreadChangeFilters(vout, sys->filter.new_filters, &sys->filter.new_interlaced, true);
     }
     vlc_mutex_unlock(&sys->filter.lock);
 
@@ -1907,9 +1911,6 @@ static void *Thread(void *object)
             switch(cmd.type) {
                 case VOUT_CONTROL_TERMINATE:
                     return NULL; /* no need to clean &cmd */
-                case VOUT_CONTROL_CHANGE_INTERLACE:
-                    ThreadChangeFilters(vout, NULL, &cmd.boolean, false);
-                    break;
                 case VOUT_CONTROL_MOUSE_STATE:
                     ThreadProcessMouseState(vout, &cmd.mouse);
                     break;



More information about the vlc-commits mailing list