[MPlayer-dev-eng] Correctly Printing FOURCCs

Jonathan Atkins jcatki at jcatki.2y.net
Thu Feb 28 16:25:05 CET 2002


Mike Melanson wrote:

> Hi team,
> 	This is a terribly minor, nagging issue that only affects
> big-endian users. The following code:
>   unsigned int fourcc;
>   printf ("fourcc: %.4s", (char *)&fourcc);
> prints the FOURCC backwards on big endian systems ('MARC' instead of
> 'CRAM', ' war' instead of 'raw '). I wanted to make a macro that will
> break it down into 4 printable chars, like so:
>   printf ("fourcc: %c%c%c%c", FOURCC_PRINTF_PARMS(fourcc));
> The macro will be replaced with the appropriate bit shifts. There are a
> bunch of files I'll have to touch to fix up all the %.4s modifiers. Just a
> heads up. If there are no serious objections and no one has a better
> solution, I'll get going on it tonight.
> 
> 	Thanks...
> --
> 	-Mike Melanson

why not just do a 4 byte swap for bigendian...or visa versa...
it can be considered a 32bit int...perhaps :)

-- 
              -=<Long Island Man>=-
                    Jon Atkins
              http://jcatki.2y.net/




More information about the MPlayer-dev-eng mailing list