# HG changeset patch # User al # Date 1351189605 0 # Node ID 95ad1e516f039a90eaf57162491b59d1418b83df # Parent cc35fea76ccc9196ff35d3f7e0f131eb3c2595c9 mp_property_deinterlace: Signalize control() failure Always having to do a GET after a SET to check if the state was really changed, seems not very friendly from the perspective of the client application that changes the property. Return M_PROPERTY_UNAVAILABLE to signalize that the control() was not positively consumed by the filter/vo chain. Based on a patch by Vicente Sendra >visenri yahoo.es< diff -r cc35fea76ccc -r 95ad1e516f03 command.c --- a/command.c Tue Oct 23 21:12:34 2012 +0000 +++ b/command.c Thu Oct 25 18:26:45 2012 +0000 @@ -1079,6 +1079,7 @@ void *arg, MPContext *mpctx) { int deinterlace, deinterlace_old; + int result; vf_instance_t *vf; if (!mpctx->sh_video || !mpctx->sh_video->vfilter) return M_PROPERTY_UNAVAILABLE; @@ -1093,18 +1094,19 @@ if (!arg) return M_PROPERTY_ERROR; M_PROPERTY_CLAMP(prop, *(int *) arg); - vf->control(vf, VFCTRL_SET_DEINTERLACE, arg); - return M_PROPERTY_OK; + result = vf->control(vf, VFCTRL_SET_DEINTERLACE, arg); + return (result == CONTROL_OK) ? M_PROPERTY_OK : M_PROPERTY_UNAVAILABLE; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: vf->control(vf, VFCTRL_GET_DEINTERLACE, &deinterlace_old); deinterlace = !deinterlace_old; - if (vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace) != CONTROL_OK) { + result = vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace); + if (result != 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; + return (result == CONTROL_OK) ? M_PROPERTY_OK : M_PROPERTY_UNAVAILABLE; } return M_PROPERTY_NOT_IMPLEMENTED; }