[Mplayer-cvslog] CVS: main/libao2 afmt.c,1.1,1.2 audio_out.h,1.8,1.9
Ivan Kalvachev
iive at mplayerhq.hu
Thu May 9 09:39:46 CEST 2002
Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv10863
Modified Files:
afmt.c audio_out.h
Log Message:
added audio_out_format_bits to calc len alignment
Index: afmt.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/afmt.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- afmt.c 11 Nov 2001 01:49:26 -0000 1.1
+++ afmt.c 9 May 2002 07:39:33 -0000 1.2
@@ -45,3 +45,40 @@
}
return("Unknown");
}
+
+// return number of bits for 1 sample in one channel, or 8 bits for compressed
+int audio_out_format_bits(int format){
+ switch (format)
+ {
+/*
+ the following two formats are not available with old linux kernel
+ headers (e.g. in 2.2.16)
+*/
+#ifdef AFMT_S32_LE
+ case AFMT_S32_LE:
+ return 32;
+#endif
+#ifdef AFMT_S32_BE
+ case AFMT_S32_BE:
+ return 32;
+#endif
+
+ case AFMT_U16_LE:
+ case AFMT_U16_BE:
+ case AFMT_S16_LE:
+ case AFMT_S16_BE:
+ return 16;//16 bits
+
+ case AFMT_MU_LAW:
+ case AFMT_A_LAW:
+ case AFMT_IMA_ADPCM:
+ case AFMT_S8:
+ case AFMT_U8:
+ case AFMT_MPEG:
+ case AFMT_AC3:
+ default:
+ return 8;//default 1 byte
+
+ }
+ return 8;
+}
\ No newline at end of file
Index: audio_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/audio_out.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- audio_out.h 25 Nov 2001 14:29:54 -0000 1.8
+++ audio_out.h 9 May 2002 07:39:33 -0000 1.9
@@ -42,6 +42,7 @@
// prototypes
extern char *audio_out_format_name(int format);
+extern int audio_out_format_bits(int format);
// NULL terminated array of all drivers
extern ao_functions_t* audio_out_drivers[];
More information about the MPlayer-cvslog
mailing list