[vlc-commits] vout: robustify "deinterlace" variable value handling
Rémi Denis-Courmont
git at videolan.org
Sat Oct 22 16:56:21 CEST 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 22 17:36:55 2016 +0300| [e65f0e5ada5034f828edb6b224efdb142e56acf9] | committer: Rémi Denis-Courmont
vout: robustify "deinterlace" variable value handling
In principles, the value should be -1, 0 or 1. This allows any
value, just looking at the sign.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e65f0e5ada5034f828edb6b224efdb142e56acf9
---
src/video_output/interlacing.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/video_output/interlacing.c b/src/video_output/interlacing.c
index 6177a3a..decd65e 100644
--- a/src/video_output/interlacing.c
+++ b/src/video_output/interlacing.c
@@ -152,7 +152,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 == -1 && !is_needed))
+ if (deinterlace_state == 0 || (deinterlace_state < 0 && !is_needed))
DeinterlaceRemove(vout);
else if (!DeinterlaceIsPresent(vout))
DeinterlaceAdd(vout);
@@ -175,7 +175,6 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, bool is_interlaced)
/* */
var_Create(vout, "deinterlace", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_HASCHOICE);
int deinterlace_state = var_GetInteger(vout, "deinterlace");
- deinterlace_state = VLC_CLIP(deinterlace_state, -1, 1);
text.psz_string = _("Deinterlace");
var_Change(vout, "deinterlace", VLC_VAR_SETTEXT, &text, NULL);
More information about the vlc-commits
mailing list