[vlc-devel] commit: XCB-XVideo: pad scanlines like VLC does ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Sep 16 17:42:54 CEST 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Sep 16 18:42:10 2009 +0300| [01b57344d042ab2c456a85611f35dfb892cec1b9] | committer: Rémi Denis-Courmont
XCB-XVideo: pad scanlines like VLC does
This fixes displaying videos with non-16-multiple pixel width.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=01b57344d042ab2c456a85611f35dfb892cec1b9
---
modules/video_output/xcb/xvideo.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index 680242c..1239c07 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -252,15 +252,16 @@ FindFormat (vout_display_t *vd,
if (chroma != ParseFormat (vd, f))
continue;
+ /* VLC pads scanline to 16 pixels internally */
+ unsigned width = (fmt->i_width + 15) & ~15;
xcb_xv_query_image_attributes_reply_t *i;
i = xcb_xv_query_image_attributes_reply (conn,
xcb_xv_query_image_attributes (conn, port, f->id,
- fmt->i_width, fmt->i_height), NULL);
+ width, fmt->i_height), NULL);
if (i == NULL)
continue;
- if (i->width != fmt->i_width
- || i->height != fmt->i_height)
+ if (i->width != width || i->height != fmt->i_height)
{
msg_Warn (vd, "incompatible size %ux%u -> %"PRIu32"x%"PRIu32,
fmt->i_width, fmt->i_height,
@@ -622,7 +623,8 @@ static void Display (vout_display_t *vd, picture_t *pic)
vd->source.i_visible_width,
vd->source.i_visible_height,
0, 0, p_sys->width, p_sys->height,
- vd->source.i_width, vd->source.i_height,
+ pic->p->i_pitch / pic->p->i_pixel_pitch,
+ pic->p->i_visible_lines,
p_sys->data_size, pic->p->p_pixels);
/* Wait for reply. See x11.c for rationale. */
More information about the vlc-devel
mailing list