[MPlayer-dev-eng] [PATCH] Patch for better pause support.

Diego Biurrun diego at biurrun.de
Tue Aug 5 10:04:12 CEST 2008


On Tue, Aug 05, 2008 at 03:53:21AM -0400, Robert Cummings wrote:
> On Tue, 2008-08-05 at 09:00 +0200, Reimar Doeffinger wrote:
> > On Sat, Aug 02, 2008 at 12:34:46AM -0400, Robert Cummings wrote:
> > > Let me know if you have any comments.
> > 
> > Please put the stay_pause_loop last in the struct, like that you only
> > have to modify those commands that need it set to 1, resulting in a much
> > smaller and easier to verify patch.
> 
> Sorry, I went for readability over succinctness. I've updated the patch
> but I made it the second from last item in the struct since the pausing
> field isn't used as a configuration setting.
> 
> --- mplayer.c	(revision 27416)
> +++ mplayer.c	(working copy)
> @@ -2352,30 +2354,46 @@
>      if (mpctx->audio_out && mpctx->sh_audio)
>  	mpctx->audio_out->pause();	// pause audio, keep data if possible
>  
> -    while ( (cmd = mp_input_get_cmd(20, 1, 1)) == NULL
> -            || cmd->id == MP_CMD_SET_MOUSE_POS) {
> -	if (cmd) {
> -	  cmd = mp_input_get_cmd(0,1,0);
> -	  mp_cmd_free(cmd);
> -	  continue;
> -	}
> -	if (mpctx->sh_video && mpctx->video_out && vo_config_count)
> -	    mpctx->video_out->check_events();
> +	while ( 1 ) {
> +		cmd = mp_input_get_cmd(20, 1, 1);
> +		if ( cmd ) {
> +			if (cmd->id == MP_CMD_SET_MOUSE_POS) {
> +	  			cmd = mp_input_get_cmd(0,1,0);
> +	  			mp_cmd_free(cmd);
> +	  			continue;
> +			}
> +			else if (cmd->stay_pause_loop) {
> +				cmd = mp_input_get_cmd(0, 1, 0);
> +				mpctx->was_paused = 1;
> +				mpctx->osd_function=OSD_PLAY;
> +				run_command(mpctx, cmd);
> +				mp_cmd_free(cmd);
> +				if (mpctx->osd_function != OSD_PAUSE) {
> +					was_paused = 0;
> +					break;
> +				}
> +			}
> +			else
> +				break;
> +		}
> +		if (mpctx->sh_video && mpctx->video_out && vo_config_count)
> +			mpctx->video_out->check_events();
>  #ifdef CONFIG_GUI
> -	if (use_gui) {
> -	    guiEventHandling();
> -	    guiGetEvent(guiReDraw, NULL);
> -	    if (guiIntfStruct.Playing!=2 || (rel_seek_secs || abs_seek_pos))
> -		break;
> -	}
> +		if (use_gui) {
> +			guiEventHandling();
> +			guiGetEvent(guiReDraw, NULL);
> +			if (guiIntfStruct.Playing!=2 || (rel_seek_secs || abs_seek_pos))
> +			break;
> +		}

Please split such cosmetics into a separate patch.

Diego



More information about the MPlayer-dev-eng mailing list