[Ffmpeg-devel] [PATCH] Allow choosing display and screen number for x11grab device
Michael Niedermayer
michaelni
Thu Dec 14 21:36:11 CET 2006
Hi
On Thu, Dec 14, 2006 at 08:51:28PM +0100, Panagiotis Issaris wrote:
> Hi,
>
> On Thu, Dec 14, 2006 at 05:50:44PM +0100, Michael Niedermayer wrote:
> > [...]
> > > Index: libavformat/x11grab.c
> > > ===================================================================
> > > --- libavformat/x11grab.c (revision 7317)
> > > +++ libavformat/x11grab.c (working copy)
> > > @@ -94,21 +94,33 @@
> > > int x_off = 0;
> > > int y_off = 0;
> > > int use_shm;
> > > + char *param, *offset;
> > >
> > > - dpy = XOpenDisplay(NULL);
> > > - if(!dpy) {
> > > + if (!ap->device) {
> > > + av_log(s1, AV_LOG_ERROR, "AVParameters don't specify any device. Use -vd.\n");
> > > + return AVERROR_IO;
> > > + }
> > > +
> > > + param = strchr(ap->device, ':');
> > > + if (!param) {
> > > av_free(st);
> > > return AVERROR_IO;
> > > }
> > > +
> > > + offset = strchr(param, '+');
> > > + if (offset) {
> > > + sscanf(offset, "%d,%d", &x_off, &y_off);
> > > + *offset = 0;
> >
> > hmm that writes into ap->device, why?
> To cut off the +xoffset,yoffset part to make it a valid X display name. I was
> not aware that ap->device would be reused or that it would be a problem for
> other reasons, but I can surely change it to pass a copy of a part of the string
> instead of a modified ("truncated") ap->device.
i dont think its reused but changing it seems hackish ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
More information about the ffmpeg-devel
mailing list