From 213eac661441a9c482f280c5cb5ec63240c8d29e Mon Sep 17 00:00:00 2001 From: Simon Farnsworth Date: Fri, 4 May 2007 18:25:14 +0100 Subject: [PATCH] Fix deinterlacing in video_out_xv.c Xv drivers are permitted to return a bigger image than we asked for, to work around hardware constraints. If this happens, 1.1.6's video_out_xv cannot deinterlace properly. Fix this by deinterlacing based on the width of the Xv image; the Xv driver will discard the extra horizontal data. Without this patch, you get a barber-pole effect if the input video is interlaced *and* the Xv driver chooses to round up the width of the requested image. -- Simon Farnsworth --- src/video_out/video_out_xv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 2cba3c2b6..dde15fb0f 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -512,17 +512,17 @@ static void xv_deinterlace_frame (xv_driver_t *this) { else recent_bitmaps[i] = NULL; - deinterlace_yuv( this->deinterlace_frame.image->data+frame->width*frame->height, - recent_bitmaps, frame->width/2, frame->height/2, this->deinterlace_method ); + deinterlace_yuv( this->deinterlace_frame.image->data+this->deinterlace_frame.image->width*frame->height, + recent_bitmaps, this->deinterlace_frame.image->width/2, frame->height/2, this->deinterlace_method ); for( i = 0; i < VO_NUM_RECENT_FRAMES; i++ ) if( this->recent_frames[i] && this->recent_frames[i]->width == frame->width && this->recent_frames[i]->height == frame->height ) - recent_bitmaps[i] = this->recent_frames[i]->image->data + frame->width*frame->height*5/4; + recent_bitmaps[i] = this->recent_frames[i]->image->data + this->deinterlace_frame.image->width*frame->height*5/4; else recent_bitmaps[i] = NULL; - deinterlace_yuv( this->deinterlace_frame.image->data+frame->width*frame->height*5/4, - recent_bitmaps, frame->width/2, frame->height/2, this->deinterlace_method ); + deinterlace_yuv( this->deinterlace_frame.image->data+this->deinterlace_frame.image->width*frame->height*5/4, + recent_bitmaps, this->deinterlace_frame.image->width/2, frame->height/2, this->deinterlace_method ); #else @@ -541,7 +541,7 @@ static void xv_deinterlace_frame (xv_driver_t *this) { recent_bitmaps[i] = NULL; deinterlace_yuv( this->deinterlace_frame.image->data, recent_bitmaps, - frame->width, frame->height, this->deinterlace_method ); + this->deinterlace_frame.image->width, frame->height, this->deinterlace_method ); } else { /* -- cgit v1.2.3