mirror of
https://github.com/mpv-player/mpv
synced 2024-11-14 22:48:35 +01:00
flickering fix, patch by Fredrik Noring <noring@nocrew.org>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7576 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
93768f46e5
commit
c9948174b9
@ -262,14 +262,8 @@ static int vo_dga_XServer_mode = 0;// index in mode list for resolution
|
||||
|
||||
#define MAX_NR_VIDEO_BUFFERS 3
|
||||
|
||||
#define VIDEO_BUFFER_DRAW \
|
||||
(vo_dga_video_buffer[vo_dga_current_video_buffer % \
|
||||
vo_dga_nr_video_buffers])
|
||||
|
||||
#define VIDEO_BUFFER_DISPLAY \
|
||||
(vo_dga_video_buffer[(vo_dga_current_video_buffer + \
|
||||
vo_dga_nr_video_buffers - 1) % \
|
||||
vo_dga_nr_video_buffers])
|
||||
#define CURRENT_VIDEO_BUFFER \
|
||||
(vo_dga_video_buffer[vo_dga_current_video_buffer])
|
||||
|
||||
static int vo_dga_nr_video_buffers; // Total number of frame buffers.
|
||||
static int vo_dga_current_video_buffer; // Buffer available for rendering.
|
||||
@ -298,7 +292,7 @@ static void draw_alpha( int x0,int y0, int w,int h, unsigned char* src, unsigned
|
||||
|
||||
offset = vo_dga_width * y0 +x0;
|
||||
buffer_stride = vo_dga_width;
|
||||
d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
|
||||
d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
|
||||
|
||||
switch( HW_MODE.vdm_mplayer_depth ){
|
||||
|
||||
@ -345,7 +339,7 @@ static uint32_t draw_frame( uint8_t *src[] ){
|
||||
char *s, *d;
|
||||
|
||||
s = *src;
|
||||
d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
|
||||
d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
|
||||
|
||||
switch(SRC_MODE.vdm_conversion_func){
|
||||
case VDM_CONV_NATIVE:
|
||||
@ -360,7 +354,7 @@ static uint32_t draw_frame( uint8_t *src[] ){
|
||||
// DBG-COde
|
||||
|
||||
#if 0
|
||||
d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
|
||||
d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
|
||||
fillblock(d, 0, 10, 0x800000ff);
|
||||
fillblock(d, 10, 10, 0x8000ff00);
|
||||
fillblock(d, 20, 10, 0x80ff0000);
|
||||
@ -429,7 +423,7 @@ static void flip_page( void )
|
||||
#ifdef HAVE_DGA2
|
||||
XDGASetViewport(vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
|
||||
0,
|
||||
VIDEO_BUFFER_DISPLAY.y,
|
||||
CURRENT_VIDEO_BUFFER.y,
|
||||
XDGAFlipRetrace);
|
||||
#else
|
||||
XF86DGASetViewPort(vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
|
||||
@ -448,7 +442,7 @@ static uint32_t draw_slice( uint8_t *src[],int stride[],
|
||||
if (scale_srcW) {
|
||||
uint8_t *dst[3] =
|
||||
{
|
||||
VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset,
|
||||
CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset,
|
||||
0,
|
||||
0
|
||||
};
|
||||
@ -457,7 +451,7 @@ static uint32_t draw_slice( uint8_t *src[],int stride[],
|
||||
/*scale_dstW*/ vo_dga_width * HW_MODE.vdm_bytespp, HW_MODE.vdm_bitspp,
|
||||
scale_srcW, scale_srcH, scale_dstW, scale_dstH);
|
||||
} else {
|
||||
yuv2rgb(VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset +
|
||||
yuv2rgb(CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset +
|
||||
(vo_dga_width * y +x) * HW_MODE.vdm_bytespp,
|
||||
src[0], src[1], src[2],
|
||||
w,h, vo_dga_width * HW_MODE.vdm_bytespp,
|
||||
|
Loading…
Reference in New Issue
Block a user