[MPlayer-dev-eng] vo_tdfxfb.c patch

Burton Samograd kruhft at kruhft.dyndns.org
Tue Aug 27 05:07:08 CEST 2002


Hi all,

I'm quite new to this list, but I was trying to get mplayer to work
with tdfxfb for a while and I managed to fix what seemed to be a
problem with gcc 3.*+: when playing a video the output would only be
the size of a single text character.

It was a pretty wierd problem.  The problem stemmed from two very
bizarre things:

1) the XYREG macro from 3dfx.h didn't seem to work
2) the values of the variable vidwidth and vidheight weren't being
retrieved properly by the compiler.

To fix the first problem i explicitly built the register value without
using the macro.  The second problem was fixed by first loading the
vidwidth and vidheight globals into temporary stack variables before
using them.

I've tested this on my system using various resolutions and video
sizes/aspects and it seems to work for all cases that I've found.
Here's the patch (i'll attach it too in case the lines get munged up
by the mailer):

Index: vo_tdfxfb.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_tdfxfb.c,v
retrieving revision 1.14
diff -r1.14 vo_tdfxfb.c
324a325,328
>       /* 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;
349c353,354
<       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);

Hope this helps.  Thanks for the great movie player :)




More information about the MPlayer-dev-eng mailing list