Mercurial > mplayer.hg
annotate libao2/afmt.c @ 9868:98ae45a0d03a
Fix serious breakage, 10000l !
author | rguyom |
---|---|
date | Mon, 07 Apr 2003 13:48:51 +0000 |
parents | c8677169cc2c |
children | 131b6c682863 |
rev | line source |
---|---|
2812 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 | |
4 #include "../config.h" | |
5 #include "afmt.h" | |
6 | |
7 char *audio_out_format_name(int format) | |
8 { | |
9 switch (format) | |
10 { | |
11 case AFMT_MU_LAW: | |
12 return("Mu-Law"); | |
13 case AFMT_A_LAW: | |
14 return("A-Law"); | |
15 case AFMT_IMA_ADPCM: | |
16 return("Ima-ADPCM"); | |
17 case AFMT_S8: | |
18 return("Signed 8-bit"); | |
19 case AFMT_U8: | |
20 return("Unsigned 8-bit"); | |
21 case AFMT_U16_LE: | |
22 return("Unsigned 16-bit (Little-Endian)"); | |
23 case AFMT_U16_BE: | |
24 return("Unsigned 16-bit (Big-Endian)"); | |
25 case AFMT_S16_LE: | |
26 return("Signed 16-bit (Little-Endian)"); | |
27 case AFMT_S16_BE: | |
28 return("Signed 16-bit (Big-Endian)"); | |
29 case AFMT_MPEG: | |
30 return("MPEG (2) audio"); | |
31 case AFMT_AC3: | |
32 return("AC3"); | |
33 /* | |
34 the following two formats are not available with old linux kernel | |
35 headers (e.g. in 2.2.16) | |
36 */ | |
37 #ifdef AFMT_S32_LE | |
38 case AFMT_S32_LE: | |
39 return("Signed 32-bit (Little-Endian)"); | |
40 #endif | |
41 #ifdef AFMT_S32_BE | |
42 case AFMT_S32_BE: | |
43 return("Signed 32-bit (Big-Endian)"); | |
44 #endif | |
8222 | 45 case AFMT_FLOAT: |
46 return("Floating Point"); | |
2812 | 47 } |
48 return("Unknown"); | |
49 } | |
6026 | 50 |
51 // return number of bits for 1 sample in one channel, or 8 bits for compressed | |
52 int audio_out_format_bits(int format){ | |
53 switch (format) | |
54 { | |
8222 | 55 case AFMT_S16_LE: |
56 case AFMT_S16_BE: | |
57 case AFMT_U16_LE: | |
58 case AFMT_U16_BE: | |
59 return 16;//16 bits | |
60 | |
6026 | 61 /* |
62 the following two formats are not available with old linux kernel | |
63 headers (e.g. in 2.2.16) | |
64 */ | |
65 #ifdef AFMT_S32_LE | |
66 case AFMT_S32_LE: | |
67 return 32; | |
68 #endif | |
69 #ifdef AFMT_S32_BE | |
70 case AFMT_S32_BE: | |
71 return 32; | |
72 #endif | |
8222 | 73 case AFMT_FLOAT: |
74 return 32; | |
6026 | 75 |
76 case AFMT_MU_LAW: | |
77 case AFMT_A_LAW: | |
78 case AFMT_IMA_ADPCM: | |
79 case AFMT_S8: | |
80 case AFMT_U8: | |
81 case AFMT_MPEG: | |
82 case AFMT_AC3: | |
83 default: | |
84 return 8;//default 1 byte | |
85 | |
86 } | |
87 return 8; | |
6335
e9bd97d5c5cc
warning & newline fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents:
6026
diff
changeset
|
88 } |