[MPlayer-dev-eng] [PATCH] ao_oss.c compilation fix

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Jan 3 13:54:11 CET 2005


Hi,
ao_oss.c won't compile with e.g. commercial OSS header because they
define AFTM_S24_LE but not AFMT_U24_LE etc.
I think this doesn't make too much sense, but nevertheless I'd like to
suggest the attached patch to fix it (taken from a mail on -users).
Do you think it is okay to apply? It looks a bit ugly with all those
#ifdefs, but I actually don't find the current way any better...

Greetings,
Reimar Döffinger
-------------- next part --------------
--- libao2/ao_oss.c.orig	2004-12-29 20:26:01.000000000 +0100
+++ libao2/ao_oss.c	2004-12-31 16:35:48.672903263 +0100
@@ -50,16 +50,28 @@
     case AF_FORMAT_U16_BE: return AFMT_U16_BE;
     case AF_FORMAT_S16_LE: return AFMT_S16_LE;
     case AF_FORMAT_S16_BE: return AFMT_S16_BE;
-#ifdef AFMT_S24_LE
+#ifdef AFMT_U24_LE
     case AF_FORMAT_U24_LE: return AFMT_U24_LE;
+#endif
+#ifdef AFMT_U24_BE
     case AF_FORMAT_U24_BE: return AFMT_U24_BE;
+#endif
+#ifdef AFMT_S24_LE
     case AF_FORMAT_S24_LE: return AFMT_S24_LE;
+#endif
+#ifdef AFMT_S24_BE
     case AF_FORMAT_S24_BE: return AFMT_S24_BE;
 #endif
-#ifdef AFMT_S32_LE
+#ifdef AFMT_U32_LE
     case AF_FORMAT_U32_LE: return AFMT_U32_LE;
+#endif
+#ifdef AFMT_U32_BE
     case AF_FORMAT_U32_BE: return AFMT_U32_BE;
+#endif
+#ifdef AFMT_S32_LE
     case AF_FORMAT_S32_LE: return AFMT_S32_LE;
+#endif
+#ifdef AFMT_S32_BE
     case AF_FORMAT_S32_BE: return AFMT_S32_BE;
 #endif
 #ifdef AFMT_FLOAT
@@ -90,16 +102,28 @@
     case AFMT_U16_BE: return AF_FORMAT_U16_BE;
     case AFMT_S16_LE: return AF_FORMAT_S16_LE;
     case AFMT_S16_BE: return AF_FORMAT_S16_BE;
-#ifdef AFMT_S24_LE
+#ifdef AFMT_U24_LE
     case AFMT_U24_LE: return AF_FORMAT_U24_LE;
+#endif
+#ifdef AFMT_U24_BE
     case AFMT_U24_BE: return AF_FORMAT_U24_BE;
+#endif
+#ifdef AFMT_S24_LE
     case AFMT_S24_LE: return AF_FORMAT_S24_LE;
+#endif
+#ifdef AFMT_S24_BE
     case AFMT_S24_BE: return AF_FORMAT_S24_BE;
 #endif
-#ifdef AFMT_S32_LE
+#ifdef AFMT_U32_LE
     case AFMT_U32_LE: return AF_FORMAT_U32_LE;
+#endif
+#ifdef AFMT_U32_BE
     case AFMT_U32_BE: return AF_FORMAT_U32_BE;
+#endif
+#ifdef AFMT_S32_LE
     case AFMT_S32_LE: return AF_FORMAT_S32_LE;
+#endif
+#ifdef AFMT_S32_BE
     case AFMT_S32_BE: return AF_FORMAT_S32_BE;
 #endif
 #ifdef AFMT_FLOAT


More information about the MPlayer-dev-eng mailing list