Commit 788a309f authored by Steve Lhomme's avatar Steve Lhomme
Browse files

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.
parent 9f1f870d
......@@ -28,7 +28,6 @@
/* */
enum {
VOUT_CONTROL_TERMINATE,
VOUT_CONTROL_CHANGE_INTERLACE, /* boolean */
VOUT_CONTROL_MOUSE_STATE, /* vlc_mouse_t */
};
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment