# HG changeset patch # User reimar # Date 1392562055 0 # Node ID 6e78b4f9569fba66a941fdd862017a97b467daf5 # Parent 1644cfb31b2f2bb2ef87a82d4f213afdcead5494 vf_screenshot: Simplify repeat screenshot handling logic. diff -r 1644cfb31b2f -r 6e78b4f9569f libmpcodecs/vf_screenshot.c --- a/libmpcodecs/vf_screenshot.c Sun Feb 16 14:47:33 2014 +0000 +++ b/libmpcodecs/vf_screenshot.c Sun Feb 16 14:47:35 2014 +0000 @@ -198,8 +198,7 @@ } if(vf->priv->shot) { - if (vf->priv->shot==1) - vf->priv->shot=0; + vf->priv->shot &= ~1; gen_fname(vf->priv); if (vf->priv->fname[0]) { if (!vf->priv->store_slices) @@ -220,13 +219,9 @@ **/ if(request==VFCTRL_SCREENSHOT) { if (data && *(int*)data) { // repeated screenshot mode - if (vf->priv->shot==2) - vf->priv->shot=0; - else - vf->priv->shot=2; + vf->priv->shot ^= 2; } else { // single screenshot - if (!vf->priv->shot) - vf->priv->shot=1; + vf->priv->shot |= 1; } return CONTROL_TRUE; }