[MPlayer-dev-eng] [PATCH] AFMT_U32_* undefined

Steven M. Schultz sms at 2BSD.COM
Wed Nov 3 22:43:29 CET 2004


Hi -

	On an old BSD system there is only AFMT_S32_BE and not the newer
	'unsigned' versions (AFMT_U32_{B,L}E) of the defines.

	This leads to errors like this:

cc -c -I../libvo -I../../libvo -I/usr/X11/include -fno-PIC -O4 -march=i686 -mcpu=i686 -pipe -ffast-math -fomit-frame-pointer -D_THREAD_SAFE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE  -I. -I..  -I/usr/contrib/include  -I/usr/local/include/SDL -D_REENTRANT -D_THREAD_SAFE -I/usr/X11/include    -o afmt.o afmt.c
afmt.c: In function `audio_out_format_name':
afmt.c:33: `AFMT_U32_LE' undeclared (first use in this function)
afmt.c:33: (Each undeclared identifier is reported only once
afmt.c:33: for each function it appears in.)
afmt.c:35: `AFMT_U32_BE' undeclared (first use in this function)
afmt.c: In function `audio_out_format_bits':
afmt.c:67: `AFMT_U32_LE' undeclared (first use in this function)
afmt.c:68: `AFMT_U32_BE' undeclared (first use in this function)
gmake[1]: *** [afmt.o] Error 1

	The attached patches to afmt.c and af_mp.c are submitted for
	consideration and simply add a #ifdef AFMT_U32_xx ... #endif pair of 
	lines around the uses of the undefined systems.

	Cheers,
	Steven Schultz
-------------- next part --------------
--- libao2/afmt.c.dist	Wed Nov  3 13:10:51 2004
+++ libao2/afmt.c	Wed Nov  3 13:32:49 2004
@@ -30,10 +30,14 @@
 	    return("MPEG (2) audio");
 	case AFMT_AC3:
 	    return("AC3");
+#ifdef AFMT_U32_LE
 	case AFMT_U32_LE:
 	    return("Unsigned 32-bit (Little-Endian)");
+#endif
+#ifdef AFMT_U32_BE
 	case AFMT_U32_BE:
 	    return("Unsigned 32-bit (Big-Endian)");
+#endif
 	case AFMT_S32_LE:
 	    return("Signed 32-bit (Little-Endian)");
 	case AFMT_S32_BE:
@@ -64,8 +68,12 @@
 
 	case AFMT_S32_LE:
 	case AFMT_S32_BE:
+#ifdef AFMT_U32_LE
 	case AFMT_U32_LE:
+#endif
+#ifdef AFMT_U32_BE
 	case AFMT_U32_BE:
+#endif
 	case AFMT_FLOAT:
 	return 32;
 
-------------- next part --------------
--- libaf/af_mp.c.dist	Wed Nov  3 13:10:51 2004
+++ libaf/af_mp.c	Wed Nov  3 13:36:27 2004
@@ -30,10 +30,14 @@
     ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break;
   case(AFMT_S32_BE):	
     ofmt = AF_FORMAT_BE|AF_FORMAT_SI; break;
+#ifdef AFMT_U32_LE
   case(AFMT_U32_LE):
     ofmt = AF_FORMAT_LE|AF_FORMAT_US; break;
+#endif
+#ifdef AFMT_U32_BE
   case(AFMT_U32_BE):	
     ofmt = AF_FORMAT_BE|AF_FORMAT_US; break;
+#endif
   case(AFMT_IMA_ADPCM):
     ofmt = AF_FORMAT_IMA_ADPCM; break;
   case(AFMT_MU_LAW):
@@ -79,7 +83,9 @@
           case 1: return AFMT_U8;
           case 2: return (fmt->format&AF_FORMAT_LE) ? AFMT_U16_LE : AFMT_U16_BE;
           case 3: return (fmt->format&AF_FORMAT_LE) ? AFMT_U24_LE : AFMT_U24_BE;
+#if defined(AF_U32_LE) && defined(AFMT_U32_BE)
           case 4: return (fmt->format&AF_FORMAT_LE) ? AFMT_U32_LE : AFMT_U32_BE;
+#endif
 	}
       }
     } else {


More information about the MPlayer-dev-eng mailing list