[vlc-commits] wl/shm: correct crop values
Rémi Denis-Courmont
git at videolan.org
Wed Sep 3 23:17:54 CEST 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Sep 4 00:16:21 2014 +0300| [a15601dbf7baae8be68a39e1627877e25b660e21] | committer: Rémi Denis-Courmont
wl/shm: correct crop values
This does not work properly because swscale is busted (it assumes that
cropping is only on the bottom and right side).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a15601dbf7baae8be68a39e1627877e25b660e21
---
modules/video_output/wl/shm.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/modules/video_output/wl/shm.c b/modules/video_output/wl/shm.c
index eb00a2f..a081240 100644
--- a/modules/video_output/wl/shm.c
+++ b/modules/video_output/wl/shm.c
@@ -88,10 +88,6 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
if (req > MAX_PICTURES)
req = MAX_PICTURES;
- vout_display_place_t place;
-
- vout_display_PlacePicture(&place, &vd->source, vd->cfg, false);
-
/* We need one extra line to cover for horizontal crop offset */
unsigned stride = 4 * ((vd->fmt.i_width + 31) & ~31);
unsigned lines = (vd->fmt.i_height + 31 + 1) & ~31;
@@ -113,6 +109,9 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
msg_Err(vd, "cannot map buffers: %s", vlc_strerror_c(errno));
goto error;
}
+#ifndef NDEBUG
+ memset(sys->base, 0x80, sys->length); /* gray fill */
+#endif
sys->shm_pool = wl_shm_create_pool(sys->shm, sys->fd, sys->length);
if (sys->shm_pool == NULL)
@@ -143,7 +142,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
break;
res.p_sys = (picture_sys_t *)buf;
- res.p[0].p_pixels = sys->base + offset;
+ res.p[0].p_pixels = sys->base + count * picsize;
offset += picsize;
picture_t *pic = picture_NewFromResource(&vd->fmt, &res);
More information about the vlc-commits
mailing list