[FFmpeg-cvslog] lavd/x11grab: fix vertical repositioning
Octavio Alvarez
git at videolan.org
Sat Apr 6 16:23:22 EEST 2019
ffmpeg | branch: master | Octavio Alvarez <octalffdev at alvarezp.org> | Wed Mar 27 22:52:32 2019 -0600| [f4f40cbb578a09319f9ddafc80388a5556ec7713] | committer: Carl Eugen Hoyos
lavd/x11grab: fix vertical repositioning
There is a calculation error in xcbgrab_reposition() that breaks
vertical repositioning on follow_mouse. It made the bottom
reposition occur when moving the mouse lower than N pixels after
the capture bottom edge, instead of before.
This commit fixes the calculation to match the documentation.
follow_mouse: centered or number of pixels. The documentation says:
When it is specified with "centered", the grabbing region follows
the mouse pointer and keeps the pointer at the center of region;
otherwise, the region follows only when the mouse pointer reaches
within PIXELS (greater than zero) to the edge of region.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f4f40cbb578a09319f9ddafc80388a5556ec7713
---
libavdevice/xcbgrab.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c
index 6d142abd4f..b7e689343e 100644
--- a/libavdevice/xcbgrab.c
+++ b/libavdevice/xcbgrab.c
@@ -127,7 +127,7 @@ static int xcbgrab_reposition(AVFormatContext *s,
int left = x + f;
int right = x + w - f;
int top = y + f;
- int bottom = y + h + f;
+ int bottom = y + h - f;
if (p_x > right) {
x += p_x - right;
} else if (p_x < left) {
More information about the ffmpeg-cvslog
mailing list