[MPlayer-cvslog] CVS: main/libao2 Makefile, 1.31, 1.32 ao_alsa.c, 1.10, 1.11 ao_alsa5.c, 1.20, 1.21 ao_arts.c, 1.9, 1.10 ao_dsound.c, 1.5, 1.6 ao_dxr2.c, 1.8, 1.9 ao_esd.c, 1.9, 1.10 ao_jack.c, 1.5, 1.6 ao_macosx.c, 1.6, 1.7 ao_mpegpes.c, 1.21, 1.22 ao_nas.c, 1.16, 1.17 ao_null.c, 1.12, 1.13 ao_oss.c, 1.45, 1.46 ao_pcm.c, 1.22, 1.23 ao_plugin.c, 1.26, 1.27 ao_polyp.c, 1.3, 1.4 ao_sdl.c, 1.38, 1.39 ao_win32.c, 1.18, 1.19 audio_out.c, 1.45, 1.46 audio_plugin.h, 1.13, 1.14 pl_delay.c, 1.8, 1.9 pl_eq.c, 1.8, 1.9 pl_extrastereo.c, 1.5, 1.6 pl_format.c, 1.8, 1.9 pl_resample.c, 1.13, 1.14 pl_surround.c, 1.14, 1.15 pl_volnorm.c, 1.7, 1.8 pl_volume.c, 1.4, 1.5 afmt.h, 1.9, NONE afmt.c, 1.8, NONE

Alex Beregszaszi syncmail at mplayerhq.hu
Mon Dec 27 18:30:20 CET 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv24154/libao2

Modified Files:
	Makefile ao_alsa.c ao_alsa5.c ao_arts.c ao_dsound.c ao_dxr2.c 
	ao_esd.c ao_jack.c ao_macosx.c ao_mpegpes.c ao_nas.c ao_null.c 
	ao_oss.c ao_pcm.c ao_plugin.c ao_polyp.c ao_sdl.c ao_win32.c 
	audio_out.c audio_plugin.h pl_delay.c pl_eq.c pl_extrastereo.c 
	pl_format.c pl_resample.c pl_surround.c pl_volnorm.c 
	pl_volume.c 
Removed Files:
	afmt.h afmt.c 
Log Message:
removing AFMT_ dependancy

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/Makefile,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- Makefile	5 Nov 2004 14:02:41 -0000	1.31
+++ Makefile	27 Dec 2004 17:30:13 -0000	1.32
@@ -2,7 +2,7 @@
 
 LIBNAME = libao2.a
 
-SRCS=afmt.c audio_out.c ao_mpegpes.c ao_null.c ao_pcm.c ao_plugin.c pl_delay.c pl_format.c pl_surround.c remez.c pl_resample.c pl_volume.c pl_extrastereo.c pl_volnorm.c pl_eq.c $(OPTIONAL_SRCS)
+SRCS=audio_out.c ao_mpegpes.c ao_null.c ao_pcm.c ao_plugin.c pl_delay.c pl_format.c pl_surround.c remez.c pl_resample.c pl_volume.c pl_extrastereo.c pl_volnorm.c pl_eq.c $(OPTIONAL_SRCS)
 
 OBJS=$(SRCS:.c=.o)
 

Index: ao_alsa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ao_alsa.c	7 Dec 2004 02:24:15 -0000	1.10
+++ ao_alsa.c	27 Dec 2004 17:30:13 -0000	1.11
@@ -37,7 +37,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 static ao_info_t info = 
 {
@@ -125,7 +125,7 @@
       }
       if(mixer_device) card = mixer_device;
 
-      if(ao_data.format == AFMT_AC3)
+      if(ao_data.format == AF_FORMAT_AC3)
 	return CONTROL_TRUE;
 
       //allocate simple id
@@ -275,42 +275,42 @@
 
     switch (format)
       {
-      case AFMT_S8:
+      case AF_FORMAT_S8:
 	alsa_format = SND_PCM_FORMAT_S8;
 	break;
-      case AFMT_U8:
+      case AF_FORMAT_U8:
 	alsa_format = SND_PCM_FORMAT_U8;
 	break;
-      case AFMT_U16_LE:
+      case AF_FORMAT_U16_LE:
 	alsa_format = SND_PCM_FORMAT_U16_LE;
 	break;
-      case AFMT_U16_BE:
+      case AF_FORMAT_U16_BE:
 	alsa_format = SND_PCM_FORMAT_U16_BE;
 	break;
 #ifndef WORDS_BIGENDIAN
-      case AFMT_AC3:
+      case AF_FORMAT_AC3:
 #endif
-      case AFMT_S16_LE:
+      case AF_FORMAT_S16_LE:
 	alsa_format = SND_PCM_FORMAT_S16_LE;
 	break;
 #ifdef WORDS_BIGENDIAN
-      case AFMT_AC3:
+      case AF_FORMAT_AC3:
 #endif
-      case AFMT_S16_BE:
+      case AF_FORMAT_S16_BE:
 	alsa_format = SND_PCM_FORMAT_S16_BE;
 	break;
-      case AFMT_S32_LE:
+      case AF_FORMAT_S32_LE:
 	alsa_format = SND_PCM_FORMAT_S32_LE;
 	break;
-      case AFMT_S32_BE:
+      case AF_FORMAT_S32_BE:
 	alsa_format = SND_PCM_FORMAT_S32_BE;
 	break;
-      case AFMT_FLOAT:
+      case AF_FORMAT_FLOAT_LE:
 	alsa_format = SND_PCM_FORMAT_FLOAT_LE;
 	break;
 
       default:
-	alsa_format = SND_PCM_FORMAT_MPEG; //? default should be -1
+	alsa_format = SND_PCM_FORMAT_MPEG2; //? default should be -1
 	break;
       }
     
@@ -412,7 +412,7 @@
      * while opening the abstract alias for the spdif subdevice
      * 'iec958'
      */
-    if (format == AFMT_AC3) {
+    if (format == AF_FORMAT_AC3) {
       unsigned char s[4];
 
       switch (channels) {
@@ -590,7 +590,7 @@
 		"alsa-init: format %s are not supported by hardware, trying default\n", 
 		audio_out_format_name(format));
          alsa_format = SND_PCM_FORMAT_S16_LE;
-         ao_data.format = AFMT_S16_LE;
+         ao_data.format = AF_FORMAT_S16_LE;
          ao_data.bps = channels * rate_hz * 2;
       }
 

Index: ao_alsa5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa5.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ao_alsa5.c	7 Dec 2004 02:24:15 -0000	1.20
+++ ao_alsa5.c	27 Dec 2004 17:30:13 -0000	1.21
@@ -13,7 +13,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 #include "mp_msg.h"
 #include "help_mp.h"
@@ -75,28 +75,28 @@
     memset(&alsa_format, 0, sizeof(alsa_format));
     switch (format)
     {
-	case AFMT_S8:
+	case AF_FORMAT_S8:
 	    alsa_format.format = SND_PCM_SFMT_S8;
 	    break;
-	case AFMT_U8:
+	case AF_FORMAT_U8:
 	    alsa_format.format = SND_PCM_SFMT_U8;
 	    break;
-	case AFMT_U16_LE:
+	case AF_FORMAT_U16_LE:
 	    alsa_format.format = SND_PCM_SFMT_U16_LE;
 	    break;
-	case AFMT_U16_BE:
+	case AF_FORMAT_U16_BE:
 	    alsa_format.format = SND_PCM_SFMT_U16_BE;
 	    break;
 #ifndef WORDS_BIGENDIAN
-	case AFMT_AC3:
+	case AF_FORMAT_AC3:
 #endif
-	case AFMT_S16_LE:
+	case AF_FORMAT_S16_LE:
 	    alsa_format.format = SND_PCM_SFMT_S16_LE;
 	    break;
 #ifdef WORDS_BIGENDIAN
-	case AFMT_AC3:
+	case AF_FORMAT_AC3:
 #endif
-	case AFMT_S16_BE:
+	case AF_FORMAT_S16_BE:
 	    alsa_format.format = SND_PCM_SFMT_S16_BE;
 	    break;
 	default:

Index: ao_arts.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_arts.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ao_arts.c	7 Dec 2004 02:24:15 -0000	1.9
+++ ao_arts.c	27 Dec 2004 17:30:13 -0000	1.10
@@ -12,12 +12,12 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "config.h"
 #include "mp_msg.h"
 #include "help_mp.h"
 
-#define OBTAIN_BITRATE(a) (((a != AFMT_U8) && (a != AFMT_S8)) ? 16 : 8)
+#define OBTAIN_BITRATE(a) (((a != AF_FORMAT_U8) && (a != AF_FORMAT_S8)) ? 16 : 8)
 
 /* Feel free to experiment with the following values: */
 #define ARTS_PACKETS 10 /* Number of audio packets */
@@ -60,12 +60,12 @@
 	 * using mplayer's audio filters.
 	 */
 	switch (format) {
-	case AFMT_U8:
-	case AFMT_S8:
-	    format = AFMT_U8;
+	case AF_FORMAT_U8:
+	case AF_FORMAT_S8:
+	    format = AF_FORMAT_U8;
 	    break;
 	default:
-	    format = AFMT_S16_LE;    /* artsd always expects little endian?*/
+	    format = AF_FORMAT_S16_LE;    /* artsd always expects little endian?*/
 	    break;
 	}
 
@@ -74,7 +74,7 @@
 	ao_data.samplerate = rate_hz;
 	ao_data.bps = (rate_hz*channels);
 
-	if(format != AFMT_U8 && format != AFMT_S8)
+	if(format != AF_FORMAT_U8 && format != AF_FORMAT_S8)
 		ao_data.bps*=2;
 
 	stream=arts_play_stream(rate_hz, OBTAIN_BITRATE(format), channels, "MPlayer");

Index: ao_dsound.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_dsound.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ao_dsound.c	8 Dec 2004 09:52:55 -0000	1.5
+++ ao_dsound.c	27 Dec 2004 17:30:13 -0000	1.6
@@ -28,7 +28,7 @@
 #define DIRECTSOUND_VERSION 0x0600
 #include <dsound.h>
 
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "audio_out.h"
 #include "audio_out_internal.h"
 #include "mp_msg.h"
@@ -265,7 +265,7 @@
   
   if (SUCCEEDED(res)) 
   {
-  	if( (ao_data.channels == 6) && (ao_data.format!=AFMT_AC3) ) {
+  	if( (ao_data.channels == 6) && (ao_data.format!=AF_FORMAT_AC3) ) {
   	    // reorder channels while writing to pointers.
   	    // it's this easy because buffer size and len are always
   	    // aligned to multiples of channels*bytespersample
@@ -366,14 +366,14 @@
 
 	//check if the format is supported in general
 	switch(format){
-		case AFMT_AC3:
-		case AFMT_S24_LE:
-		case AFMT_S16_LE:
-		case AFMT_S8:
+		case AF_FORMAT_AC3:
+		case AF_FORMAT_S24_LE:
+		case AF_FORMAT_S16_LE:
+		case AF_FORMAT_S8:
 			break;
 		default:
 			mp_msg(MSGT_AO, MSGL_V,"ao_dsound: format %s not supported defaulting to Signed 16-bit Little-Endian\n",audio_out_format_name(format));
-			format=AFMT_S16_LE;
+			format=AF_FORMAT_S16_LE;
 	}   	
 	//fill global ao_data
 	ao_data.channels = channels;
@@ -389,7 +389,7 @@
 	wformat.Format.cbSize          = (channels > 2) ? sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX) : 0;
 	wformat.Format.nChannels       = channels;
 	wformat.Format.nSamplesPerSec  = rate;
-	if (format == AFMT_AC3) {
+	if (format == AF_FORMAT_AC3) {
 		wformat.Format.wFormatTag      = WAVE_FORMAT_DOLBY_AC3_SPDIF;
 		wformat.Format.wBitsPerSample  = 16;
 		wformat.Format.nBlockAlign     = 4;

Index: ao_dxr2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_dxr2.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ao_dxr2.c	7 Dec 2004 02:24:15 -0000	1.8
+++ ao_dxr2.c	27 Dec 2004 17:30:13 -0000	1.9
@@ -11,8 +11,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 
 static ao_info_t info =
@@ -158,9 +157,9 @@
 // return: number of bytes played
 static int play(void* data,int len,int flags){
   // MPEG and AC3 don't work :-(
-    if(ao_data.format==AFMT_MPEG)
+    if(ao_data.format==AF_FORMAT_MPEG2)
 	dxr2_send_packet(data,len,0xC0,ao_data.pts);
-    else if(ao_data.format==AFMT_AC3)
+    else if(ao_data.format==AF_FORMAT_AC3)
       	dxr2_send_packet(data,len,0x80,ao_data.pts);
     else {
 	int i;

Index: ao_esd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_esd.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ao_esd.c	7 Dec 2004 02:30:09 -0000	1.9
+++ ao_esd.c	27 Dec 2004 17:30:13 -0000	1.10
@@ -32,7 +32,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "config.h"
 #include "mp_msg.h"
 #include "help_mp.h"
@@ -200,14 +200,14 @@
 
     /* EsounD can play 8bit unsigned and 16bit signed native */
     switch (format) {
-    case AFMT_S8:
-    case AFMT_U8:
+    case AF_FORMAT_S8:
+    case AF_FORMAT_U8:
 	esd_fmt |= ESD_BITS8;
-	ao_data.format = AFMT_U8;
+	ao_data.format = AF_FORMAT_U8;
 	break;
     default:
 	esd_fmt |= ESD_BITS16;
-	ao_data.format = AFMT_S16_NE;
+	ao_data.format = AF_FORMAT_S16_NE;
 	bytes_per_sample *= 2;
 	break;
     }

Index: ao_jack.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_jack.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ao_jack.c	7 Dec 2004 02:24:15 -0000	1.5
+++ ao_jack.c	27 Dec 2004 17:30:13 -0000	1.6
@@ -14,7 +14,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "config.h"
 #include "mp_msg.h"
 
@@ -146,14 +146,14 @@
 	}
 
 	switch (format) {
-		case AFMT_U8:
-		case AFMT_S8:
-			format = AFMT_U8;
+		case AF_FORMAT_U8:
+		case AF_FORMAT_S8:
+			format = AF_FORMAT_U8;
 			bits_per_sample = 8;
 			m = 1;
 			break;
 		default:
-			format = AFMT_S16_LE;
+			format = AF_FORMAT_S16_LE;
 			bits_per_sample = 16;
 			m = 2;
 			break;

Index: ao_macosx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_macosx.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ao_macosx.c	7 Dec 2004 02:24:15 -0000	1.6
+++ ao_macosx.c	27 Dec 2004 17:30:13 -0000	1.7
@@ -47,7 +47,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 static ao_info_t info =
   {
@@ -252,7 +252,7 @@
     if (ao->outputStreamBasicDescription.mFormatID == kAudioFormatLinearPCM) {
       uint32_t flags = ao->outputStreamBasicDescription.mFormatFlags;
       if (flags & kAudioFormatFlagIsFloat) {
-	ao_data.format = AFMT_FLOAT;
+	ao_data.format = AF_FORMAT_FLOAT_NE;
       } else {
 	ao_msg(MSGT_AO,MSGL_WARN, "Unsupported audio output "
 	       "format %d. Please report this to the developer\n",

Index: ao_mpegpes.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_mpegpes.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ao_mpegpes.c	7 Dec 2004 02:24:15 -0000	1.21
+++ ao_mpegpes.c	27 Dec 2004 17:30:13 -0000	1.22
@@ -15,7 +15,7 @@
 #include "audio_out.h"
 #include "audio_out_internal.h"
 
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 #include "mp_msg.h"
 #include "help_mp.h"
@@ -96,14 +96,14 @@
     ao_data.channels=2;
     ao_data.outburst=2000;
     switch(format){
-	case AFMT_S16_LE:
-	case AFMT_S16_BE:
-	case AFMT_MPEG:
-	case AFMT_AC3:
+	case AF_FORMAT_S16_LE:
+	case AF_FORMAT_S16_BE:
+	case AF_FORMAT_MPEG2:
+	case AF_FORMAT_AC3:
 	    ao_data.format=format;
 	    break;
 	default:
-	    ao_data.format=AFMT_S16_BE;
+	    ao_data.format=AF_FORMAT_S16_BE;
     }
     
 retry:
@@ -174,14 +174,14 @@
 // return: number of bytes played
 static int play(void* data,int len,int flags){
 //    printf("\nao_mpegpes: play(%d) freq=%d\n",len,freq_id);
-    if(ao_data.format==AFMT_MPEG)
+    if(ao_data.format==AF_FORMAT_MPEG2)
 	send_pes_packet(data,len,0x1C0,ao_data.pts);
     else {
 	int i;
 	unsigned short *s=data;
 //	if(len>2000) len=2000;
 //	printf("ao_mpegpes: len=%d  \n",len);
-	if(ao_data.format==AFMT_S16_LE || ao_data.format==AFMT_AC3)
+	if(ao_data.format==AF_FORMAT_S16_LE || ao_data.format==AF_FORMAT_AC3)
 	    for(i=0;i<len/2;i++) s[i]=(s[i]>>8)|(s[i]<<8); // le<->be
 	send_lpcm_packet(data,len,0xA0,ao_data.pts,freq_id);
     }

Index: ao_nas.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_nas.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ao_nas.c	7 Dec 2004 02:24:15 -0000	1.16
+++ ao_nas.c	27 Dec 2004 17:30:13 -0000	1.17
@@ -37,7 +37,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 #define NAS_FRAG_SIZE 4096
 
@@ -312,22 +312,22 @@
 static unsigned int nas_aformat_to_auformat(unsigned int *format)
 {
 	switch (*format) {
-	case	AFMT_U8:
+	case	AF_FORMAT_U8:
 		return AuFormatLinearUnsigned8;
-	case	AFMT_S8:
+	case	AF_FORMAT_S8:
 		return AuFormatLinearSigned8;
-	case	AFMT_U16_LE:
+	case	AF_FORMAT_U16_LE:
 		return AuFormatLinearUnsigned16LSB;
-	case	AFMT_U16_BE:
+	case	AF_FORMAT_U16_BE:
 		return AuFormatLinearUnsigned16MSB;
-	case	AFMT_S16_LE:
+	case	AF_FORMAT_S16_LE:
 		return AuFormatLinearSigned16LSB;
-	case	AFMT_S16_BE:
+	case	AF_FORMAT_S16_BE:
 		return AuFormatLinearSigned16MSB;
-	case	AFMT_MU_LAW:
+	case	AF_FORMAT_MU_LAW:
 		return AuFormatULAW8;
 	default:
-		*format=AFMT_S16_NE;
+		*format=AF_FORMAT_S16_NE;
 		return nas_aformat_to_auformat(format);
 	}
 }

Index: ao_null.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_null.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ao_null.c	18 Sep 2004 20:31:27 -0000	1.12
+++ ao_null.c	27 Dec 2004 17:30:13 -0000	1.13
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <sys/time.h>
 
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "audio_out.h"
 #include "audio_out_internal.h"
 
@@ -55,7 +55,7 @@
     ao_data.samplerate=rate;
     ao_data.format=format;
     ao_data.bps=channels*rate;
-    if (format != AFMT_U8 && format != AFMT_S8)
+    if (format != AF_FORMAT_U8 && format != AF_FORMAT_S8)
 	ao_data.bps*=2; 
     buffer=0;
     gettimeofday(&last_tv, 0);

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- ao_oss.c	7 Dec 2004 02:24:15 -0000	1.45
+++ ao_oss.c	27 Dec 2004 17:30:13 -0000	1.46
@@ -9,14 +9,21 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
-//#include <sys/soundcard.h>
 
 #include "config.h"
 #include "mp_msg.h"
 #include "mixer.h"
 #include "help_mp.h"
 
-#include "afmt.h"
+#ifdef HAVE_SYS_SOUNDCARD_H
+#include <sys/soundcard.h>
+#else
+#ifdef HAVE_SOUNDCARD_H
+#include <soundcard.h>
+#endif
+#endif
+
+#include "../libaf/af_format.h"
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
@@ -33,6 +40,86 @@
 
 LIBAO_EXTERN(oss)
 
+static int format2oss(int format)
+{
+    switch(format)
+    {
+    case AF_FORMAT_U8: return AFMT_U8;
+    case AF_FORMAT_S8: return AFMT_S8;
+    case AF_FORMAT_U16_LE: return AFMT_U16_LE;
+    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
+    case AF_FORMAT_U24_LE: return AFMT_U24_LE;
+    case AF_FORMAT_U24_BE: return AFMT_U24_BE;
+    case AF_FORMAT_S24_LE: return AFMT_S24_LE;
+    case AF_FORMAT_S24_BE: return AFMT_S24_BE;
+#endif
+#ifdef AFMT_S32_LE
+    case AF_FORMAT_U32_LE: return AFMT_U32_LE;
+    case AF_FORMAT_U32_BE: return AFMT_U32_BE;
+    case AF_FORMAT_S32_LE: return AFMT_S32_LE;
+    case AF_FORMAT_S32_BE: return AFMT_S32_BE;
+#endif
+#ifdef AFMT_FLOAT
+    case AF_FORMAT_FLOAT_NE: return AFMT_FLOAT;
+#endif
+    // SPECIALS
+    case AF_FORMAT_MU_LAW: return AFMT_MU_LAW;
+    case AF_FORMAT_A_LAW: return AFMT_A_LAW;
+    case AF_FORMAT_IMA_ADPCM: return AFMT_IMA_ADPCM;
+#ifdef AFMT_MPEG
+    case AF_FORMAT_MPEG2: return AFMT_MPEG;
+#endif
+#ifdef AFMT_AC3
+    case AF_FORMAT_AC3: return AFMT_AC3;
+#endif
+    }
+    printf("Unknown format: %x\n", format);
+    return -1;
+}
+
+static int oss2format(int format)
+{
+    switch(format)
+    {
+    case AFMT_U8: return AF_FORMAT_U8;
+    case AFMT_S8: return AF_FORMAT_S8;
+    case AFMT_U16_LE: return AF_FORMAT_U16_LE;
+    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
+    case AFMT_U24_LE: return AF_FORMAT_U24_LE;
+    case AFMT_U24_BE: return AF_FORMAT_U24_BE;
+    case AFMT_S24_LE: return AF_FORMAT_S24_LE;
+    case AFMT_S24_BE: return AF_FORMAT_S24_BE;
+#endif
+#ifdef AFMT_S32_LE
+    case AFMT_U32_LE: return AF_FORMAT_U32_LE;
+    case AFMT_U32_BE: return AF_FORMAT_U32_BE;
+    case AFMT_S32_LE: return AF_FORMAT_S32_LE;
+    case AFMT_S32_BE: return AF_FORMAT_S32_BE;
+#endif
+#ifdef AFMT_FLOAT
+    case AFMT_FLOAT: return AF_FORMAT_FLOAT_NE;
+#endif
+    // SPECIALS
+    case AFMT_MU_LAW: return AF_FORMAT_MU_LAW;
+    case AFMT_A_LAW: return AF_FORMAT_A_LAW;
+    case AFMT_IMA_ADPCM: return AF_FORMAT_IMA_ADPCM;
+#ifdef AFMT_MPEG
+    case AFMT_MPEG: return AF_FORMAT_MPEG2;
+#endif
+#ifdef AFMT_AC3
+    case AFMT_AC3: return AF_FORMAT_AC3;
+#endif
+    }
+    printf("Unknown format: %x\n", format);
+    return -1;
+}
+
 static char *dsp=PATH_DEV_DSP;
 static audio_buf_info zz;
 static int audio_fd=-1;
@@ -57,7 +144,7 @@
 	    ao_control_vol_t *vol = (ao_control_vol_t *)arg;
 	    int fd, v, devs;
 
-	    if(ao_data.format == AFMT_AC3)
+	    if(ao_data.format == AF_FORMAT_AC3)
 		return CONTROL_TRUE;
     
 	    if ((fd = open(oss_mixer_device, O_RDONLY)) > 0)
@@ -95,9 +182,10 @@
 // return: 1=success 0=fail
 static int init(int rate,int channels,int format,int flags){
   char *mixer_channels [SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
+  int oss_format;
 
-  mp_msg(MSGT_AO,MSGL_V,"ao2: %d Hz  %d chans  %s\n",rate,channels,
-    audio_out_format_name(format));
+//  mp_msg(MSGT_AO,MSGL_V,"ao2: %d Hz  %d chans  %s\n",rate,channels,
+//    audio_out_format_name(format));
 
   if (ao_subdevice)
     dsp = ao_subdevice;
@@ -160,32 +248,39 @@
   fcntl(audio_fd, F_SETFD, FD_CLOEXEC);
 #endif
   
-  if(format == AFMT_AC3) {
+  if(format == AF_FORMAT_AC3) {
     ao_data.samplerate=rate;
     ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate);
   }
 
 ac3_retry:  
   ao_data.format=format;
-  if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &ao_data.format)<0 ||
-      ao_data.format != format) if(format == AFMT_AC3){
+  oss_format=format2oss(format);
+  if (oss_format == -1) return 0;
+  if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &oss_format)<0 ||
+      oss_format != format2oss(format)) if(format == AF_FORMAT_AC3){
     mp_msg(MSGT_AO,MSGL_WARN, MSGTR_AO_OSS_CantSetAC3, dsp);
 #ifdef WORDS_BIGENDIAN
-    format=AFMT_S16_BE;
+    oss_format=AFMT_S16_BE;
+    format=AF_FORMAT_S16_BE;
 #else
-    format=AFMT_S16_LE;
+    oss_format=AFMT_S16_LE;
+    format=AF_FORMAT_S16_LE;
 #endif
     goto ac3_retry;
   }
-  mp_msg(MSGT_AO,MSGL_V,"audio_setup: sample format: %s (requested: %s)\n",
-    audio_out_format_name(ao_data.format), audio_out_format_name(format));
+//  mp_msg(MSGT_AO,MSGL_V,"audio_setup: sample format: %s (requested: %s)\n",
+//    audio_out_format_name(ao_data.format), audio_out_format_name(format));
 #if 0
-  if(ao_data.format!=format)
+  if(oss_format!=format2oss(format))
 	mp_msg(MSGT_AO,MSGL_WARN,"WARNING! Your soundcard does NOT support %s sample format! Broken audio or bad playback speed are possible! Try with '-aop list=format'\n",audio_out_format_name(format));
 #endif
+
+  ao_data.format = oss2format(oss_format);
+  if (ao_data.format == -1) return 0;
   
   ao_data.channels = channels;
-  if(format != AFMT_AC3) {
+  if(format != AF_FORMAT_AC3) {
     // We only use SNDCTL_DSP_CHANNELS for >2 channels, in case some drivers don't have it
     if (ao_data.channels > 2) {
       if ( ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &ao_data.channels) == -1 ||
@@ -253,7 +348,7 @@
   }
 
   ao_data.bps=ao_data.channels;
-  if(ao_data.format != AFMT_U8 && ao_data.format != AFMT_S8)
+  if(ao_data.format != AF_FORMAT_U8 && ao_data.format != AF_FORMAT_S8)
     ao_data.bps*=2;
 
   ao_data.outburst-=ao_data.outburst % ao_data.bps; // round down
@@ -280,6 +375,7 @@
 
 // stop playing and empty buffers (for seeking/pause)
 static void reset(){
+  int oss_format;
     uninit(1);
     audio_fd=open(dsp, O_WRONLY);
     if(audio_fd < 0){
@@ -291,8 +387,9 @@
   fcntl(audio_fd, F_SETFD, FD_CLOEXEC);
 #endif
 
-  ioctl (audio_fd, SNDCTL_DSP_SETFMT, &ao_data.format);
-  if(ao_data.format != AFMT_AC3) {
+  oss_format = format2oss(ao_data.format);
+  ioctl (audio_fd, SNDCTL_DSP_SETFMT, &oss_format);
+  if(ao_data.format != AF_FORMAT_AC3) {
     if (ao_data.channels > 2)
       ioctl (audio_fd, SNDCTL_DSP_CHANNELS, &ao_data.channels);
     else {

Index: ao_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_pcm.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ao_pcm.c	7 Dec 2004 02:24:15 -0000	1.22
+++ ao_pcm.c	27 Dec 2004 17:30:14 -0000	1.23
@@ -5,7 +5,7 @@
 #include <string.h>
 
 #include "bswap.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "audio_out.h"
 #include "audio_out_internal.h"
 #include "mp_msg.h"
@@ -89,12 +89,12 @@
 
 	bits=8;
 	switch(format){
-	case AFMT_S8:
-	    format=AFMT_U8;
-	case AFMT_U8:
+	case AF_FORMAT_S8:
+	    format=AF_FORMAT_U8;
+	case AF_FORMAT_U8:
 	    break;
 	default:
-	    format=AFMT_S16_LE;
+	    format=AF_FORMAT_S16_LE;
 	    bits=16;
 	    break;
 	}
@@ -114,9 +114,9 @@
 	wavhdr.data_length=le2me_32(0x7ffff000);
 	wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
 
-	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename, 
-	       (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, 
-	       (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
+//	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename, 
+//	       (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, 
+//	       (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
 	mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_HintInfo);
 
 	fp = fopen(ao_outputfilename, "wb");

Index: ao_plugin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_plugin.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ao_plugin.c	7 Dec 2004 02:24:15 -0000	1.26
+++ ao_plugin.c	27 Dec 2004 17:30:14 -0000	1.27
@@ -6,7 +6,7 @@
 
 #include "mp_msg.h"
 #include "help_mp.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "audio_out.h"
 #include "audio_out_internal.h"
 
@@ -140,7 +140,7 @@
 
   ao_plugin_local_data.format=format;
   ao_plugin_local_data.channels=channels;
-  ao_plugin_local_data.bpm=audio_out_format_bits(format);
+  ao_plugin_local_data.bpm=af_fmt2bits(format);
 
   ao_plugin_data.rate=rate;
   ao_plugin_data.channels=channels;
@@ -168,7 +168,7 @@
   // Calculate bps
   ao_plugin_local_data.bps=(float)(ao_plugin_data.rate * 
 				   ao_plugin_data.channels);
-  ao_plugin_local_data.bps*=audio_out_format_bits(ao_plugin_data.format)/8;
+  ao_plugin_local_data.bps*=af_fmt2bits(ao_plugin_data.format)/8;
 
   // This should never happen but check anyway 
   if(NULL==ao_plugin_local_data.driver)

Index: ao_polyp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_polyp.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ao_polyp.c	7 Dec 2004 02:30:09 -0000	1.3
+++ ao_polyp.c	27 Dec 2004 17:30:14 -0000	1.4
@@ -6,7 +6,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "config.h"
 #include "mp_msg.h"
 
@@ -91,16 +91,16 @@
     ss.rate = rate_hz;
 
     switch (format) {
-        case AFMT_U8:
+        case AF_FORMAT_U8:
             ss.format = PA_SAMPLE_U8;
             break;
-        case AFMT_S16_LE:
+        case AF_FORMAT_S16_LE:
             ss.format = PA_SAMPLE_S16LE;
             break;
-        case AFMT_S16_BE:
+        case AF_FORMAT_S16_BE:
             ss.format = PA_SAMPLE_S16BE;
             break;
-        case AFMT_FLOAT:
+        case AF_FORMAT_FLOAT_NE:
             ss.format = PA_SAMPLE_FLOAT32;
             break;
         default:

Index: ao_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sdl.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- ao_sdl.c	7 Dec 2004 02:24:15 -0000	1.38
+++ ao_sdl.c	27 Dec 2004 17:30:14 -0000	1.39
@@ -20,7 +20,7 @@
 
 #include "audio_out.h"
 #include "audio_out_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include <SDL.h>
 #include "osdep/timer.h"
 
@@ -181,7 +181,7 @@
 	/* Allocate ring-buffer memory */
 	buffer = (unsigned char *) malloc(BUFFSIZE);
 
-	mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_SDL_INFO, rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
+//	mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_SDL_INFO, rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
 
 	if(ao_subdevice) {
 		setenv("SDL_AUDIODRIVER", ao_subdevice, 1);
@@ -193,32 +193,32 @@
 	ao_data.format=format;
 
 	ao_data.bps=channels*rate;
-	if(format != AFMT_U8 && format != AFMT_S8)
+	if(format != AF_FORMAT_U8 && format != AF_FORMAT_S8)
 	  ao_data.bps*=2;
 	
 	/* The desired audio format (see SDL_AudioSpec) */
 	switch(format) {
-	    case AFMT_U8:
+	    case AF_FORMAT_U8:
 		aspec.format = AUDIO_U8;
 	    break;
-	    case AFMT_S16_LE:
+	    case AF_FORMAT_S16_LE:
 		aspec.format = AUDIO_S16LSB;
 	    break;
-	    case AFMT_S16_BE:
+	    case AF_FORMAT_S16_BE:
 		aspec.format = AUDIO_S16MSB;
 	    break;
-	    case AFMT_S8:
+	    case AF_FORMAT_S8:
 		aspec.format = AUDIO_S8;
 	    break;
-	    case AFMT_U16_LE:
+	    case AF_FORMAT_U16_LE:
 		aspec.format = AUDIO_U16LSB;
 	    break;
-	    case AFMT_U16_BE:
+	    case AF_FORMAT_U16_BE:
 		aspec.format = AUDIO_U16MSB;
 	    break;
 	    default:
                 aspec.format = AUDIO_S16LSB;
-                ao_data.format = AFMT_S16_LE;
+                ao_data.format = AF_FORMAT_S16_LE;
                 mp_msg(MSGT_AO,MSGL_WARN,MSGTR_AO_SDL_UnsupportedAudioFmt, format);
 	}
 
@@ -256,22 +256,22 @@
 
 	switch(obtained.format) {
 	    case AUDIO_U8 :
-		ao_data.format = AFMT_U8;
+		ao_data.format = AF_FORMAT_U8;
 	    break;
 	    case AUDIO_S16LSB :
-		ao_data.format = AFMT_S16_LE;
+		ao_data.format = AF_FORMAT_S16_LE;
 	    break;
 	    case AUDIO_S16MSB :
-		ao_data.format = AFMT_S16_BE;
+		ao_data.format = AF_FORMAT_S16_BE;
 	    break;
 	    case AUDIO_S8 :
-		ao_data.format = AFMT_S8;
+		ao_data.format = AF_FORMAT_S8;
 	    break;
 	    case AUDIO_U16LSB :
-		ao_data.format = AFMT_U16_LE;
+		ao_data.format = AF_FORMAT_U16_LE;
 	    break;
 	    case AUDIO_U16MSB :
-		ao_data.format = AFMT_U16_BE;
+		ao_data.format = AF_FORMAT_U16_BE;
 	    break;
 	    default:
                 mp_msg(MSGT_AO,MSGL_WARN,MSGTR_AO_SDL_UnsupportedAudioFmt, obtained.format);

Index: ao_win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_win32.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ao_win32.c	8 Dec 2004 09:52:55 -0000	1.18
+++ ao_win32.c	27 Dec 2004 17:30:14 -0000	1.19
@@ -23,7 +23,7 @@
 #include <windows.h>
 #include <mmsystem.h>
 
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "audio_out.h"
 #include "audio_out_internal.h"
 #include "mp_msg.h"
@@ -149,21 +149,21 @@
 	int i;
    
 	switch(format){
-		case AFMT_AC3:
-		case AFMT_S24_LE:
-		case AFMT_S16_LE:
-		case AFMT_S8:
+		case AF_FORMAT_AC3:
+		case AF_FORMAT_S24_LE:
+		case AF_FORMAT_S16_LE:
+		case AF_FORMAT_S8:
 			break;
 		default:
 			mp_msg(MSGT_AO, MSGL_V,"ao_win32: format %s not supported defaulting to Signed 16-bit Little-Endian\n",audio_out_format_name(format));
-			format=AFMT_S16_LE;
+			format=AF_FORMAT_S16_LE;
 	}   
 	//fill global ao_data 
 	ao_data.channels=channels;
 	ao_data.samplerate=rate;
 	ao_data.format=format;
 	ao_data.bps=channels*rate;
-	if(format != AFMT_U8 && format != AFMT_S8)
+	if(format != AF_FORMAT_U8 && format != AF_FORMAT_S8)
 	  ao_data.bps*=2;
 	if(ao_data.buffersize==-1)
 	{
@@ -179,7 +179,7 @@
     wformat.Format.cbSize          = (channels>2)?sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX):0;
     wformat.Format.nChannels       = channels;                
     wformat.Format.nSamplesPerSec  = rate;            
-    if(format == AFMT_AC3)
+    if(format == AF_FORMAT_AC3)
     {
         wformat.Format.wFormatTag      = WAVE_FORMAT_DOLBY_AC3_SPDIF;
         wformat.Format.wBitsPerSample  = 16;
@@ -208,7 +208,7 @@
 		mp_msg(MSGT_AO, MSGL_ERR,"ao_win32: format not supported switching to default\n");
         ao_data.channels = wformat.Format.nChannels = 2;
 	    ao_data.samplerate = wformat.Format.nSamplesPerSec = 44100;
-	    ao_data.format = AFMT_S16_LE;
+	    ao_data.format = AF_FORMAT_S16_LE;
 		ao_data.bps=ao_data.channels * ao_data.samplerate*2;
 	    wformat.Format.wBitsPerSample=16;
         wformat.Format.wFormatTag=WAVE_FORMAT_PCM;

Index: audio_out.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/audio_out.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- audio_out.c	7 Dec 2004 02:24:15 -0000	1.45
+++ audio_out.c	27 Dec 2004 17:30:14 -0000	1.46
@@ -4,7 +4,6 @@
 
 #include "config.h"
 #include "audio_out.h"
-#include "afmt.h"
 
 #include "mp_msg.h"
 #include "help_mp.h"
@@ -187,6 +186,7 @@
 	    audio_out_plugin.control(AOCONTROL_SET_PLUGIN_DRIVER,audio_out);
 	    audio_out=&audio_out_plugin;
 	}
+//	if(audio_out->control(AOCONTROL_QUERY_FORMAT, (int)format) == CONTROL_TRUE)
 	if(audio_out->init(rate,channels,format,flags))
 	    return audio_out; // success!
     }

Index: audio_plugin.h
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/audio_plugin.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- audio_plugin.h	21 Mar 2003 16:42:50 -0000	1.13
+++ audio_plugin.h	27 Dec 2004 17:30:14 -0000	1.14
@@ -45,7 +45,7 @@
 // Configuration defaults
 #define CFG_DEFAULTS { \
  NULL, \
- AFMT_S16_LE, \
+ AF_FORMAT_S16_LE, \
  0, \
  48000, \
  101, \

Index: pl_delay.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_delay.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- pl_delay.c	4 Oct 2003 17:28:58 -0000	1.8
+++ pl_delay.c	27 Dec 2004 17:30:14 -0000	1.9
@@ -12,7 +12,7 @@
 #include "audio_out.h"
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 static ao_info_t info =
 {
@@ -65,7 +65,7 @@
 
   // Tell ao_plugin how much this plugin adds to the overall time delay
   time_delay=-1*(float)ao_plugin_cfg.pl_delay_len/((float)pl_delay.channels*(float)pl_delay.rate);
-  if(pl_delay.format != AFMT_U8 && pl_delay.format != AFMT_S8)
+  if(pl_delay.format != AF_FORMAT_U8 && pl_delay.format != AF_FORMAT_S8)
     time_delay/=2;
   ao_plugin_data.delay_fix+=time_delay;
 

Index: pl_eq.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_eq.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- pl_eq.c	21 Mar 2003 16:42:50 -0000	1.8
+++ pl_eq.c	27 Dec 2004 17:30:14 -0000	1.9
@@ -24,7 +24,7 @@
 #include "audio_out.h"
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 #include "eq.h"
 
 static ao_info_t info =
@@ -122,7 +122,7 @@
   float F[KM] = CF;
   
   // Check input format
-  if(ao_plugin_data.format != AFMT_S16_NE){
+  if(ao_plugin_data.format != AF_FORMAT_S16_NE){
     fprintf(stderr,"[pl_eq] Input audio format not yet supported. \n");
     return 0;
   }

Index: pl_extrastereo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_extrastereo.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- pl_extrastereo.c	21 Mar 2003 16:42:50 -0000	1.5
+++ pl_extrastereo.c	27 Dec 2004 17:30:14 -0000	1.6
@@ -19,7 +19,7 @@
 #include "audio_out.h"
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 static ao_info_t info = {
         "Extra stereo plugin",
@@ -57,7 +57,7 @@
 // return: 1=success 0=fail
 static int init(){
   switch(ao_plugin_data.format){
-  case(AFMT_S16_NE):
+  case(AF_FORMAT_S16_NE):
     break;
   default:
     fprintf(stderr,"[pl_extrastereo] Audio format not yet suported \n");
@@ -87,7 +87,7 @@
 static int play(){
 
   switch(pl_extrastereo.format){
-  case(AFMT_S16_NE): {
+  case(AF_FORMAT_S16_NE): {
 
     int16_t* data=(int16_t*)ao_plugin_data.data;
     int len=ao_plugin_data.len / 2; // 16 bits samples

Index: pl_format.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_format.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- pl_format.c	21 Mar 2003 16:42:50 -0000	1.8
+++ pl_format.c	27 Dec 2004 17:30:14 -0000	1.9
@@ -16,7 +16,7 @@
 #include "audio_out.h"
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 static ao_info_t info =
 {
@@ -75,29 +75,30 @@
 // open & setup audio device
 // return: 1=success 0=fail
 static int init(){
+  char buf1[128], buf2[128];
   // Sheck input format
   switch(ao_plugin_data.format){
-  case(AFMT_U8):
+  case(AF_FORMAT_U8):
     pl_format.in=LE|B08|US; break;
-  case(AFMT_S8):
+  case(AF_FORMAT_S8):
     pl_format.in=LE|B08|SI; break;
-  case(AFMT_S16_LE):
+  case(AF_FORMAT_S16_LE):
     pl_format.in=LE|B16|SI; break;
-  case(AFMT_S16_BE):
+  case(AF_FORMAT_S16_BE):
     pl_format.in=BE|B16|SI; break;
-  case(AFMT_U16_LE):	
+  case(AF_FORMAT_U16_LE):	
     pl_format.in=LE|B16|US; break;
-  case(AFMT_U16_BE):	
+  case(AF_FORMAT_U16_BE):	
     pl_format.in=BE|B16|US; break;
-  case(AFMT_S32_LE):
+  case(AF_FORMAT_S32_LE):
     pl_format.in=LE|B32|SI; break;
-  case(AFMT_S32_BE):	
+  case(AF_FORMAT_S32_BE):	
     pl_format.in=BE|B32|SI; break;
-  case(AFMT_IMA_ADPCM):		
-  case(AFMT_MU_LAW):
-  case(AFMT_A_LAW):
-  case(AFMT_MPEG):
-  case(AFMT_AC3):
+  case(AF_FORMAT_IMA_ADPCM):		
+  case(AF_FORMAT_MU_LAW):
+  case(AF_FORMAT_A_LAW):
+  case(AF_FORMAT_MPEG2):
+  case(AF_FORMAT_AC3):
     printf("[pl_format] Input audio format not yet suported \n");
     return 0;
   default: 
@@ -106,27 +107,27 @@
   }
   // Sheck output format
   switch(ao_plugin_cfg.pl_format_type){
-  case(AFMT_U8):
+  case(AF_FORMAT_U8):
     pl_format.out=LE|B08|US; break;
-  case(AFMT_S8):
+  case(AF_FORMAT_S8):
     pl_format.out=LE|B08|SI; break;
-  case(AFMT_S16_LE):
+  case(AF_FORMAT_S16_LE):
     pl_format.out=LE|B16|SI; break;
-  case(AFMT_S16_BE):
+  case(AF_FORMAT_S16_BE):
     pl_format.out=BE|B16|SI; break;
-  case(AFMT_U16_LE):	
+  case(AF_FORMAT_U16_LE):	
     pl_format.out=LE|B16|US; break;
-  case(AFMT_U16_BE):	
+  case(AF_FORMAT_U16_BE):	
     pl_format.out=BE|B16|US; break;
-  case(AFMT_S32_LE):
+  case(AF_FORMAT_S32_LE):
     pl_format.out=LE|B32|SI; break;
-  case(AFMT_S32_BE):	
+  case(AF_FORMAT_S32_BE):	
     pl_format.out=BE|B32|SI; break;
-  case(AFMT_IMA_ADPCM):		
-  case(AFMT_MU_LAW):
-  case(AFMT_A_LAW):
-  case(AFMT_MPEG):
-  case(AFMT_AC3):
+  case(AF_FORMAT_IMA_ADPCM):		
+  case(AF_FORMAT_MU_LAW):
+  case(AF_FORMAT_A_LAW):
+  case(AF_FORMAT_MPEG2):
+  case(AF_FORMAT_AC3):
     printf("[pl_format] Output audio format not yet suported \n");
     return 0;
   default:
@@ -136,8 +137,8 @@
 
   // Tell the world what we are up to
   printf("[pl_format] Input format: %s, output format: %s \n",
-	 audio_out_format_name(ao_plugin_data.format),
-	 audio_out_format_name(ao_plugin_cfg.pl_format_type));
+	 af_fmt2str(ao_plugin_data.format, &buf1, 128),
+	 af_fmt2str(ao_plugin_cfg.pl_format_type, &buf2, 128));
 
   // We are changing the format
   ao_plugin_data.format=ao_plugin_cfg.pl_format_type;

Index: pl_resample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_resample.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- pl_resample.c	21 Mar 2003 16:42:50 -0000	1.13
+++ pl_resample.c	27 Dec 2004 17:30:14 -0000	1.14
@@ -23,7 +23,7 @@
 #include "audio_out.h"
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 static ao_info_t info =
 {
@@ -119,7 +119,7 @@
   pl_resample.up=UP;
 
   // Sheck input format
-  if(ao_plugin_data.format != AFMT_S16_NE){
+  if(ao_plugin_data.format != AF_FORMAT_S16_NE){
     fprintf(stderr,"[pl_resample] Input audio format not yet suported. \n");
     return 0;
   }

Index: pl_surround.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_surround.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- pl_surround.c	21 Mar 2003 16:42:50 -0000	1.14
+++ pl_surround.c	27 Dec 2004 17:30:14 -0000	1.15
@@ -44,7 +44,7 @@
 #include "audio_out.h"
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 #include "remez.h"
 #include "firfilter.c"
@@ -108,8 +108,8 @@
     pl_surround.passthrough = 1;
     return 1;
   }
-  if (ao_plugin_data.format != AFMT_S16_NE) {
-    fprintf(stderr, "pl_surround: I'm dumb and can only handle AFMT_S16_NE audio format, using passthrough mode\n");
+  if (ao_plugin_data.format != AF_FORMAT_S16_NE) {
+    fprintf(stderr, "pl_surround: I'm dumb and can only handle AF_FORMAT_S16_NE audio format, using passthrough mode\n");
     pl_surround.passthrough = 1;
     return 1;
   }

Index: pl_volnorm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_volnorm.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- pl_volnorm.c	21 Mar 2003 16:42:50 -0000	1.7
+++ pl_volnorm.c	27 Dec 2004 17:30:14 -0000	1.8
@@ -30,7 +30,7 @@
 #include "audio_out.h"
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 static ao_info_t info = {
         "Volume normalizer",
@@ -116,7 +116,7 @@
 // return: 1=success 0=fail
 static int init(){
   switch(ao_plugin_data.format){
-    case(AFMT_S16_NE):
+    case(AF_FORMAT_S16_NE):
       break;
     default:
       fprintf(stderr,"[pl_volnorm] Audio format not yet supported.\n");
@@ -142,7 +142,7 @@
   int i;
   mul = MUL_INIT;
   switch(ao_plugin_data.format) {
-    case(AFMT_S16_NE):
+    case(AF_FORMAT_S16_NE):
 #if AVG==1
       lastavg = MID_S16;
 #elif AVG==2
@@ -165,7 +165,7 @@
 static int play(){
 
   switch(pl_volnorm.format){
-  case(AFMT_S16_NE): {
+  case(AF_FORMAT_S16_NE): {
 #define CLAMP(x,m,M) do { if ((x)<(m)) (x) = (m); else if ((x)>(M)) (x) = (M); } while(0)
 
     int16_t* data=(int16_t*)ao_plugin_data.data;

Index: pl_volume.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_volume.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- pl_volume.c	21 Mar 2003 16:42:50 -0000	1.4
+++ pl_volume.c	27 Dec 2004 17:30:14 -0000	1.5
@@ -20,7 +20,7 @@
 #include "audio_out.h"
 #include "audio_plugin.h"
 #include "audio_plugin_internal.h"
-#include "afmt.h"
+#include "libaf/af_format.h"
 
 static ao_info_t info =
 {
@@ -80,8 +80,8 @@
 static int init(){
   // Sanity sheck this plugin supports AFMT_U8 and AFMT_S16_LE
   switch(ao_plugin_data.format){
-  case(AFMT_U8):
-  case(AFMT_S16_NE):
+  case(AF_FORMAT_U8):
+  case(AF_FORMAT_S16_NE):
     break;
   default: 
     fprintf(stderr,"[pl_volume] Audio format not yet suported \n");
@@ -117,7 +117,7 @@
   vol=(vol*vol*vol)>>12;
   // Change the volume.
   switch(pl_volume.format){
-  case(AFMT_U8):{
+  case(AF_FORMAT_U8):{
     register uint8_t* data=(uint8_t*)ao_plugin_data.data;
     register int x;
       for(i=0;i<ao_plugin_data.len;i++){
@@ -135,7 +135,7 @@
       }
       break;
   }
-  case(AFMT_S16_NE):{
+  case(AF_FORMAT_S16_NE):{
     register int len=ao_plugin_data.len>>1;
     register int16_t* data=(int16_t*)ao_plugin_data.data;
     register int x;

--- afmt.h DELETED ---

--- afmt.c DELETED ---




More information about the MPlayer-cvslog mailing list