[MPlayer-dev-eng] [PATCH] dirty frame stepping and and stay in pause after seek

Alban Bedel albeu at free.fr
Thu Jul 18 16:07:16 CEST 2002


Hi Michael Niedermayer,

on Thu, 18 Jul 2002 15:27:59 +0200 you wrote:

> Index: mplayer.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/mplayer.c,v
> retrieving revision 1.527
> diff -u -r1.527 mplayer.c
> --- mplayer.c	12 Jul 2002 00:53:24 -0000	1.527
> +++ mplayer.c	18 Jul 2002 13:33:47 -0000
> @@ -1963,8 +1963,11 @@
>          guiGetEvent( guiCEvent,(char *)guiSetPlay );
>         }
>  #endif
> +
>        if(pkey!=32 && pkey!=112)
>          mplayer_put_key(pkey); // pass on the key
> +      if(pkey!=32)
> +         osd_function=OSD_PAUSE;
>    }
>  
>  // handle -sstep
> @@ -2024,16 +2027,20 @@
>        (!use_stdin && (c=getch2(0))>0) || (c=mplayer_get_key())>0) switch(c){
>      // seek 10 sec
>      case KEY_RIGHT:
> +      if(osd_function==OSD_PAUSE) mplayer_put_key(32);
>        osd_function=OSD_FFW;
>        rel_seek_secs+=10;break;
>      case KEY_LEFT:
> +      if(osd_function==OSD_PAUSE) mplayer_put_key(32);
>        osd_function=OSD_REW;
>        rel_seek_secs-=10;break;
>      // seek 1 min
>      case KEY_UP:
> +      if(osd_function==OSD_PAUSE) mplayer_put_key(32);
>        osd_function=OSD_FFW;
>        rel_seek_secs+=60;break;
>      case KEY_DOWN:
> +      if(osd_function==OSD_PAUSE) mplayer_put_key(32);
>        osd_function=OSD_REW;
>        rel_seek_secs-=60;break;
>      // seek 10 min

This is the old input code wich isn't used by default and afaik it's planned to remove
it.

> @@ -2314,6 +2321,7 @@
>        int v,abs;
>        v = cmd->args[0].v.i;
>        abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0;
> +      if(osd_function==OSD_PAUSE) mplayer_put_key(32);
>        if(abs) {
>  	abs_seek_pos = 3;
>  	if(sh_video)
> 

This is the new code where command are indepandant from the key used (it may not
even come from a keyboard event). So it doesn't make sense to use
mplayer_put_key here as this key may not trigger the event you want if the user
have different key binding. You must use mp_input_queue_cmd with the right
command here (see input/input.[ch]).
Anyway I just took i quick look at the pausing code and it need a big cleanup. The
mix betewen the new/old/gui code is a real mess. It's easy to remove the old input
code should i do it now ?
	Albeu



More information about the MPlayer-dev-eng mailing list