summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-28 16:22:02 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-28 16:22:02 +0000
commite9d168f902c275e14ad5b35c636c629693497281 (patch)
treebae91a31b9b2d148a2a8e848ca2986e8c3f5df30 /libvo
parent0dbb552406e2637e8c43a0229573ace0f736fa9b (diff)
downloadmpv-e9d168f902c275e14ad5b35c636c629693497281.tar.bz2
mpv-e9d168f902c275e14ad5b35c636c629693497281.tar.xz
clear screen and tiny image bug patch by Burton Samograd <kruhft@kruhft.dyndns.org>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7114 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_tdfxfb.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/libvo/vo_tdfxfb.c b/libvo/vo_tdfxfb.c
index 418389d243..4c2ff1b68d 100644
--- a/libvo/vo_tdfxfb.c
+++ b/libvo/vo_tdfxfb.c
@@ -153,8 +153,16 @@ static void uninit(void)
static void clear_screen()
{
- if(vo_doublebuffering) {
- memset(vidpage, 0, screenwidth * screenheight * screendepth);
+ /* There needs to be some sort of delay here or else things seriously screw up.
+ Causes the image to not be the right size on screen if this isn't like this.
+ A printf before the memset call also seems to work, but this made more sense
+ since it actually checks the status of the card.
+ */
+ do {
+ memset(vidpage, 0, screenwidth * screenheight * screendepth);
+ } while((reg_IO->status & 0x1f) < 1);
+
+ if(vo_doublebuffering) {
memset(hidpage, 0, screenwidth * screenheight * screendepth);
}
}
@@ -171,9 +179,14 @@ static void setup_screen(uint32_t full)
if(screenwidth / ratio <= screenheight)
vidheight = (double)screenwidth / ratio;
+ /* Is this really needed? This causes movies that are encoded at YxY
+ sizes to not be displayed properly (they're squished horizontally).
+ This might cause problems with videos that are taller than they are wide
+ but I haven't really seen many of those so we won't worry about it for now. */
+#if 0
else
vidwidth = (double)screenheight * ratio;
-
+#endif
vidx = (screenwidth - vidwidth) / 2;
vidy = (screenheight - vidheight) / 2;
} else { /* Reset to normal size */
@@ -185,7 +198,7 @@ static void setup_screen(uint32_t full)
vidheight = r_height;
vidx = vidy = 0;
}
-
+
clear_screen();
}
@@ -265,12 +278,11 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
in_voodoo_format |= in_width * in_depth;
- /* Linux lives in the first frame */
- if(vo_doublebuffering) {
- vidpageoffset = screenwidth * screenheight * screendepth;
- hidpageoffset = vidpageoffset + screenwidth * screenheight * screendepth;
- } else
- vidpageoffset = hidpageoffset = 0; /* Console background */
+ /* Put the image pages off the console screen so they don't get console messages */
+ /* This used to place single buffered movies onto the main console screen */
+ vidpageoffset = hidpageoffset = screenwidth * screenheight * screendepth;
+ if(vo_doublebuffering)
+ hidpageoffset = vidpageoffset + screenwidth * screenheight * screendepth;
inpageoffset = hidpageoffset + screenwidth * screenheight * screendepth;
@@ -322,6 +334,10 @@ static void flip_page(void)
{
voodoo_2d_reg regs = *reg_2d; /* Copy the regs */
int i = 0;
+ /* This has to be done of else setting dstSize doesn't work */
+ /* Must be a gcc 3.0+ bug */
+ int tempvidheight = vidheight;
+ int tempvidwidth = vidwidth;
if(vo_doublebuffering) {
/* Flip to an offscreen buffer for rendering */
@@ -346,7 +362,8 @@ static void flip_page(void)
reg_2d->dstBaseAddr = vidpageoffset;
reg_2d->dstXY = XYREG(vidx, vidy);
reg_2d->dstFormat = vid_voodoo_format;
- reg_2d->dstSize = XYREG(vidwidth, vidheight);
+ /* The XYREG macro doesn't seem to work for this line so build the register contents very explicitly */
+ reg_2d->dstSize = ((((unsigned long)vidheight) & 0x0000FFFF) << 16) | (((unsigned long) vidwidth) & 0x0000FFFF);
reg_2d->command = S2S_STRECH_BLT | S2S_IMMED | S2S_ROP;
/* Wait for the command to finish (If we don't do this, we get wierd