[Ffmpeg-devel] [PATCH] Make x11grab output mouse warning only once

Michael Niedermayer michaelni
Wed Jan 31 20:41:45 CET 2007


Hi

On Wed, Jan 31, 2007 at 11:34:16AM +0100, Panagiotis Issaris wrote:
> Hi,
> 
> On Wed, 2007-01-31 at 11:04 +0100, Panagiotis Issaris wrote:
> > Hi,
> > 
> > On Wed, 2007-01-31 at 04:14 +0100, Michael Niedermayer wrote:
> > > Hi
> > > 
> > > On Wed, Jan 31, 2007 at 03:01:29AM +0100, Panagiotis Issaris wrote:
> > > > Hi,
> > > > 
> > > > The attached patch makes x11grab output its warning that it
> > > > couldn't find the mouse pointer only once. This to prevent
> > > > flooding of the terminal when grabbing from a different X screen.
> > > > 
> > > >  x11grab.c |    6 +++++-
> > > >  1 file changed, 5 insertions(+), 1 deletion(-)
> > > > 
> > > > I'm not sure everybody will like this, because if the "error" reoccurs,
> > > > the warning will not. In my case, when grabbing from -f x11grab -vd x11:0.1
> > > > while working on :0.0, the continuous outputting of warnings hides all
> > > > useful FFmpeg info.
> > > 
> > > rejected, 
> > As expected...
> > 
> > > the existence of a mouse pointer is not a global property as
> > > such the use of a static variable is not appropriate
> > 
> > > 
> > > if i have 2 x11grab instances i want 2 warnings or none if neither can
> > > find the mouse
> > ... although for an other reason then I had anticipated :) 
> > 
> > Hmm. To be able to do this correct, I would think I'd have to add a
> > similar variable to x11_grab_t. Would that be okay?
> The attached patch provides it not as a global variable but as a member
> of the context, so that the warning can be show once per x11grab
> instance. Doesn't look that nice to me though...
> 
> Furthermore, this patch is not tested as I do not have a dual-screen
> setup here at work.

[...]
> @@ -237,6 +238,7 @@
>      x11grab->y_off = y_off;
>      x11grab->image = image;
>      x11grab->use_shm = use_shm;
> +    x11grab->mouse_warning_shown = 0;

isnt the context allocated with av_mallocz() ? so this should be unneeded?
either way patch ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070131/b74a5319/attachment.pgp>



More information about the ffmpeg-devel mailing list