[MPlayer-dev-eng] [PATCH] img_format.h needs config.h

Alan Curry pacman at TheWorld.com
Thu Feb 9 08:26:00 CET 2006


img_format.h defines the IMGFMT_* constants differently based on #ifdef
WORDS_BIGENDIAN, but it doesn't include config.h which is where
WORDS_BIGENDIAN comes from. So anyone who includes img_format.h without
having included config.h first gets the wrong definitions on bigendian.

One such place is img_format.c! vo_format_name() actually returns the wrong
names for ARGB/ABGR because it's using the wrong constants.

The easy way to prevent such problems is to include config.h directly at the
top of img_format.h

-------------- next part --------------
Index: libmpcodecs/img_format.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/img_format.h,v
retrieving revision 1.16
diff -u -r1.16 img_format.h
--- libmpcodecs/img_format.h	11 Aug 2004 01:41:43 -0000	1.16
+++ libmpcodecs/img_format.h	9 Feb 2006 06:58:47 -0000
@@ -2,6 +2,8 @@
 #ifndef __IMG_FORMAT_H
 #define __IMG_FORMAT_H
 
+#include "config.h" /* for WORDS_BIGENDIAN */
+
 /* RGB/BGR Formats */
 
 #define IMGFMT_RGB_MASK 0xFFFFFF00


More information about the MPlayer-dev-eng mailing list