# HG changeset patch # User al # Date 1350846108 0 # Node ID 75e4ee082dd2534dfdab0b163514a90c0b8b4e34 # Parent 6f214e8ae780bf4757bcd20e0f3c4f9fba2ce032 mp_property_deinterlace: Improve OSD feedback Do not show wrong OSD if setting of property deinterlace fails or is not supported by current video chain. This was particularly misleading because if you e.g. were using mplayer without a deinterlacing filter and your vo didn't have deinterlacing support. The OSD output of the property would appear like it got stuck at "enabled". Patch by Vicente Sendra >visenri yahoo.es< with a few changes by me. diff -r 6f214e8ae780 -r 75e4ee082dd2 command.c --- a/command.c Sun Oct 21 15:00:48 2012 +0000 +++ b/command.c Sun Oct 21 19:01:48 2012 +0000 @@ -1078,7 +1078,7 @@ static int mp_property_deinterlace(m_option_t *prop, int action, void *arg, MPContext *mpctx) { - int deinterlace; + int deinterlace, deinterlace_old; vf_instance_t *vf; if (!mpctx->sh_video || !mpctx->sh_video->vfilter) return M_PROPERTY_UNAVAILABLE; @@ -1097,9 +1097,11 @@ return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - vf->control(vf, VFCTRL_GET_DEINTERLACE, &deinterlace); - deinterlace = !deinterlace; - vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace); + vf->control(vf, VFCTRL_GET_DEINTERLACE, &deinterlace_old); + deinterlace = !deinterlace_old; + if (vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace) != CONTROL_OK) { + deinterlace = deinterlace_old; + } set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDDeinterlace, deinterlace ? MSGTR_Enabled : MSGTR_Disabled); return M_PROPERTY_OK;