[vlc-devel] [PATCH 05/17] video_output: use filter lock to change deinterlacing in the vout thread
Steve Lhomme
robux4 at ycbcr.xyz
Mon Sep 14 16:03:16 CEST 2020
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.
---
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 ed4613d6c14..91819d0b321 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 5a906f62508..a0852dcd7dd 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;
--
2.26.2
More information about the vlc-devel
mailing list