[MPlayer-dev-eng] [PATCH] Fix unpause with key_down_event command

Adrian Stutz adrian at sttz.ch
Tue Jan 6 22:57:53 CET 2009


Currently, it's not possible to unpause MPlayer with the key_down_event
command (with a key code mapped to the pause command, of course).

Steps to reproduce:
mplayer -quiet -slave movie.avi
key_down_event 32
# MPlayer pauses
key_down_event 32
# MPlayer plays a frame and then pauses again
pause
# MPlayer unpauses correctly

Here's what happens:
* The key_down_event command will exit the pause loop without being
processed
* The main loop processed the key_down_event and resolves it to the pause
command
* The pause command gets processed and re-pauses playback

The attached patch takes advantage of the new run_command in the pause_loop
and lets it process the key_down_event command.

The only thing the key_down_command does is re-injecting the key into the
input anyway, so there should be no problems as far as I can tell. This way,
the key_down_event gets processed as a regular key event, exits the pause
loop with CMD_PAUSE and is handled correctly. As added benefit,
key_down_event will no longer exit the pause loop if there's no binding for
the key code.

(Interestingly, MPlayer OSX is using key_down_event and many users use the
space bar to pause/unpause movies. That only works because the short time
MPlayer returns to playback triggers other commands that then exit the pause
loop.)

Greetings
Adrian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keydown_cmd_pause.diff
Type: application/octet-stream
Size: 550 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090106/ebb2bc23/attachment.obj>


More information about the MPlayer-dev-eng mailing list