summaryrefslogtreecommitdiffstats
path: root/libvo/vo_fbdev.c
diff options
context:
space:
mode:
authorszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-29 17:59:21 +0000
committerszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-29 17:59:21 +0000
commite8a7a0f9e9c3dea26b87efd0f5fb3f8be1fd83ec (patch)
tree9a99cdfcee780cab4a95853fadb9b7acd632778d /libvo/vo_fbdev.c
parentdcb0840e674d5bcb768259f1c5af7e44761113aa (diff)
downloadmpv-e8a7a0f9e9c3dea26b87efd0f5fb3f8be1fd83ec.tar.bz2
mpv-e8a7a0f9e9c3dea26b87efd0f5fb3f8be1fd83ec.tar.xz
alpha rendering, virtual screensize reset fix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@252 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_fbdev.c')
-rw-r--r--libvo/vo_fbdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c
index 4e9602947e..178d637f40 100644
--- a/libvo/vo_fbdev.c
+++ b/libvo/vo_fbdev.c
@@ -171,7 +171,6 @@ static int fb_init(void)
printf("fb_init: Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
return 1;
}
- close(fb_dev_fd);
printf("fb_init: framebuffer @ %p\n", frame_buffer);
printf("fb_init: framebuffer size: %d bytes\n", fb_size);
@@ -274,9 +273,9 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
dst = next_frame + (in_width * (y0 + y) + x0) * (fb_bpp / 8);
for (x = 0; x < w; x++) {
if (srca[x]) {
- dst[0] = (dst[0]*(srca[x]^255)+src[x]*(srca[x]))>>8;
- dst[1] = (dst[1]*(srca[x]^255)+src[x]*(srca[x]))>>8;
- dst[2] = (dst[2]*(srca[x]^255)+src[x]*(srca[x]))>>8;
+ dst[0]=((dst[0]*srca[x])>>8)+src[x];
+ dst[1]=((dst[1]*srca[x])>>8)+src[x];
+ dst[2]=((dst[2]*srca[x])>>8)+src[x];
}
dst += fb_bpp / 8;
}
@@ -340,6 +339,7 @@ static void uninit(void)
fb_var_info.yres_virtual = fb_yres_virtual;
if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_var_info))
printf("vo_fbdev: Can't set virtual screensize to original value: %s\n", strerror(errno));
+ close(fb_dev_fd);
memset(next_frame, '\0', in_height * in_width * (fb_bpp / 8));
put_frame();
if (vt_active >= 0)