[MPlayer-dev-eng] De- and reactivate yadif

Michael Niedermayer michaelni at gmx.at
Sat Nov 18 11:32:36 CET 2006


Hi

On Fri, Nov 17, 2006 at 07:38:22PM +0100, Carl Eugen Hoyos wrote:
> Attached patch allows to de- and reactivate yadif.
> I think it's very useful, although mplayer has to be started with -vf 
> yadif to make the patch work.
> 
> Greetings, Carl Eugen
> 

> Index: libmpcodecs/vf_yadif.c
> ===================================================================
> --- libmpcodecs/vf_yadif.c      (Revision 20990)
> +++ libmpcodecs/vf_yadif.c      (Arbeitskopie)
> @@ -391,10 +391,13 @@
> 
>  static int continue_buffered_image(struct vf_instance_s *vf);
>  extern int correct_pts;
> +static int do_deinterlace=1;

this should be part of the context, there can be multiple instances


[...]
> @@ -469,6 +472,21 @@
>      return 0;
>  }
> 
> +static int control(struct vf_instance_s* vf, int request, void* data){
> +    switch (request){
> +      case VFCTRL_GET_DEINTERLACE:
> +        *(int*)data = do_deinterlace;
> +        return CONTROL_OK;
> +      case VFCTRL_SET_DEINTERLACE:
> +        if (*(int*)data == -1)
> +            do_deinterlace = !do_deinterlace;
> +        else
> +            do_deinterlace = *(int*)data;

set, get ok but do_deinterlace = !do_deinterlace; is redundant, considering
that this would have to be added to every deinterlacing filter set(!get) at
one central spot is better 


> +        return CONTROL_OK;
> +    }
> +    return CONTROL_NA;

this is wrong and breaks the control message passing, see any other filter
which implements control()


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is



More information about the MPlayer-dev-eng mailing list