[MPlayer-dev-eng] [PATCH] enable/disable idle mode via input command in mplayer

Attila Kinali attila at kinali.ch
Sun Mar 14 13:55:50 CET 2010


On Mon, 22 Feb 2010 02:05:19 +0100
Johannes Krude <johannes at krude.de> wrote:

> I enhanced  mplayer to be able to switch beetwen idle ond noidle any time.
> 
> example:
> 
>     $ ./mplayer -slave -idle
>     MPlayer SVN-r30689-4.3.3 (C) 2000-2010 MPlayer Team
>     idle 0
>     
>     Exiting... (End of file)
> ===================================================================
> --- mplayer.c	(Revision 30689)
> +++ mplayer.c	(Arbeitskopie)
> @@ -3077,6 +3077,7 @@
>          case MP_CMD_QUIT:
>              exit_player_with_rc(EXIT_QUIT, (cmd->nargs > 0)? cmd->args[0].v.i : 0);
>              break;
> +        case MP_CMD_IDLE:
>          case MP_CMD_GET_PROPERTY:
>          case MP_CMD_SET_PROPERTY:
>          case MP_CMD_STEP_PROPERTY:
> @@ -3108,6 +3109,12 @@
>          }
>          filename = play_tree_iter_get_file(mpctx->playtree_iter, 1);
>      }
> +
> +    if (!player_idle_mode) {
> +        mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,MSGTR_Exit_eof);
> +        exit_player_with_rc(EXIT_NONE, 0);
> +    }
> +
>  }
>  //---------------------------------------------------------------------------
>  

I don't see why you'd have to add here a special case to
exit when player_idle_mode is not set, as the while loop
will keep looping as long as player_idle_mode is 1.
If i understand the code correctly, it'll even break playing
of multiple files.

Other than this, the patch looks ok.

Any other comments?


			Attila Kinali

-- 
Why does it take years to find the answers to
the questions one should have asked long ago?



More information about the MPlayer-dev-eng mailing list