summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2008-12-27 17:40:57 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2008-12-27 17:40:57 +0200
commitc1b80dcbbb34d63df65c0f52c0bede66dfa225e8 (patch)
tree2b929ffa6f2896bdee81729ceab2b9651c62055f /libvo
parenta76f59b0390a408de0a666cb1edfc578b734596a (diff)
parent4f6c6ba61a1fc213c7356b9ae1b9467f177a67a5 (diff)
downloadmpv-c1b80dcbbb34d63df65c0f52c0bede66dfa225e8.tar.bz2
mpv-c1b80dcbbb34d63df65c0f52c0bede66dfa225e8.tar.xz
Merge svn changes up to r28204
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_gl.c24
-rw-r--r--libvo/vo_x11.c1
-rw-r--r--libvo/x11_common.c1
3 files changed, 23 insertions, 3 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 7ad0189a63..4178daff9c 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -407,7 +407,10 @@ static void autodetectGlExtensions(void) {
int is_ati = strstr(vendor, "ATI") != NULL;
if (ati_hack == -1) ati_hack = is_ati;
if (force_pbo == -1) force_pbo = strstr(extensions, "_pixel_buffer_object") ? is_ati : 0;
- if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 2 : 0;
+ if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 0 : 0;
+ if (is_ati && (lscale == 1 || lscale == 2 || cscale == 1 || cscale == 2))
+ mp_msg(MSGT_VO, MSGL_WARN, "Selected scaling mode may be broken on ATI cards.\n"
+ "Tell _them_ to fix GL_REPEAT if you have issues.\n");
}
/**
@@ -782,6 +785,18 @@ static uint32_t get_image(mp_image_t *mpi) {
return VO_TRUE;
}
+static void clear_border(uint8_t *dst, int start, int stride, int height, int full_height, int value) {
+ int right_border = stride - start;
+ int bottom_border = full_height - height;
+ while (height > 0) {
+ memset(dst + start, value, right_border);
+ dst += stride;
+ height--;
+ }
+ if (bottom_border > 0)
+ memset(dst, value, stride * bottom_border);
+}
+
static uint32_t draw_image(mp_image_t *mpi) {
int slice = slice_height;
int stride[3];
@@ -799,6 +814,13 @@ static uint32_t draw_image(mp_image_t *mpi) {
memcpy_pic(mpi2.planes[1], mpi->planes[1], mpi->w >> 1, mpi->h >> 1, mpi2.stride[1], mpi->stride[1]);
memcpy_pic(mpi2.planes[2], mpi->planes[2], mpi->w >> 1, mpi->h >> 1, mpi2.stride[2], mpi->stride[2]);
}
+ if (ati_hack) { // since we have to do a full upload we need to clear the borders
+ clear_border(mpi2.planes[0], mpi->w * bpp / 8, mpi2.stride[0], mpi->h, mpi2.height, 0);
+ if (mpi->imgfmt == IMGFMT_YV12) {
+ clear_border(mpi2.planes[1], mpi->w >> 1, mpi2.stride[1], mpi->h >> 1, mpi2.height >> 1, 128);
+ clear_border(mpi2.planes[2], mpi->w >> 1, mpi2.stride[2], mpi->h >> 1, mpi2.height >> 1, 128);
+ }
+ }
mpi = &mpi2;
}
stride[0] = mpi->stride[0]; stride[1] = mpi->stride[1]; stride[2] = mpi->stride[2];
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 5c204e417f..0af5331891 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -53,7 +53,6 @@ static const vo_info_t info = {
const LIBVO_EXTERN(x11)
/* private prototypes */
-static void Display_Image(XImage * myximage, unsigned char *ImageData);
static void (*draw_alpha_fnc) (int x0, int y0, int w, int h,
unsigned char *src, unsigned char *srca,
int stride);
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 9e6e31bd59..2c9677c997 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -578,7 +578,6 @@ void vo_x11_putkey(struct vo *vo, int key)
{
static const char *passthrough_keys = " -+*/<>`~!@#$%^&()_{}:;\"\',.?\\|=[]";
int mpkey = 0;
- int i;
if ((key >= 'a' && key <= 'z') ||
(key >= 'A' && key <= 'Z') ||
(key >= '0' && key <= '9') ||