[MPlayer-dev-eng] [PATCH] fix for mplayer input bugs: shooting to memory+lost events

Joey Parrish joey at nicewarrior.org
Mon Sep 6 17:45:52 CEST 2004


On Fri, Sep 03, 2004 at 01:09:20PM -0500, Stephen Stocker wrote:
>   Hi,
> 
>   This patch was submitted by Mikulas on June 30, and I wonder if
>   someone could please look at it and apply if it's OK?
> 
>   Its fixes a bug which occurs with SVGAlib, where if you hold down the
>   left arrow key to back up to the start of a video (or any key, for
>   that matter), then hit some other key (to change brightness, for
>   example), MPlayer will back up to the start of the video again.
> 
>   This patch still works on current CVS, btw. Here's the URL and a copy
>   of the original post. Thanks!
> 
>   Steve
> 
> http://mplayerhq.hu/pipermail/mplayer-users/2004-June/046528.html
> 
>    --------------------------------------------------------------------------
> 
>  Hi
> 
>  This patch fixes two problems in mplayer input key system:
> 
>  1. shooting to stack when only partial data are read from pipe (note that
>  when adding number to pointer, the number is multiplied by size of pointer
>  type).
> 
>  2. delayed events on svgalib:
> 
>  The problem is caused by getch2, getch2 does buffering of handle 0,
>  however getch2 is called only when handle 0 is reported as readable by
>  select.
> 
>  It manifests like this:
>  - User holds key so that key repeat rate is higher than frame rate
>          (key presses are put into buffer in getch2)
>  - User releases key
>          (handle 0 is no longer reported as readable, however there are
>           still charactes in getch2 buffer, but getch2 is not called
>           anymore)
>  - User presses another key --- few keypresses of previous key are still
>  processed.
>          (getch2 is called and previous content of getch2 buffer is
>           processed)
> 
>  The patch changes it so that getch2 is always called regardless of select
>  state of handle 0 --- it makes sense because getch2 calls select itself.

So, in your example about holding down seek for a while...
When I let go of seek, will all the waiting keypresses be processed, or
will the buffer be flushed?

--Joey

-- 
"Are disorders necessarily bad?" --Ike




More information about the MPlayer-dev-eng mailing list