Mercurial > mplayer.hg
annotate libao2/afmt.c @ 13187:ec342714b8a9
small fixes
author | rathann |
---|---|
date | Sat, 28 Aug 2004 20:56:56 +0000 |
parents | 131b6c682863 |
children | 661718721c92 |
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 case AFMT_S32_LE: | |
34 return("Signed 32-bit (Little-Endian)"); | |
35 case AFMT_S32_BE: | |
36 return("Signed 32-bit (Big-Endian)"); | |
8222 | 37 case AFMT_FLOAT: |
38 return("Floating Point"); | |
2812 | 39 } |
40 return("Unknown"); | |
41 } | |
6026 | 42 |
43 // return number of bits for 1 sample in one channel, or 8 bits for compressed | |
44 int audio_out_format_bits(int format){ | |
45 switch (format) | |
46 { | |
8222 | 47 case AFMT_S16_LE: |
48 case AFMT_S16_BE: | |
49 case AFMT_U16_LE: | |
50 case AFMT_U16_BE: | |
51 return 16;//16 bits | |
52 | |
6026 | 53 case AFMT_S32_LE: |
54 case AFMT_S32_BE: | |
8222 | 55 case AFMT_FLOAT: |
56 return 32; | |
6026 | 57 |
58 case AFMT_MU_LAW: | |
59 case AFMT_A_LAW: | |
60 case AFMT_IMA_ADPCM: | |
61 case AFMT_S8: | |
62 case AFMT_U8: | |
63 case AFMT_MPEG: | |
64 case AFMT_AC3: | |
65 default: | |
66 return 8;//default 1 byte | |
67 | |
68 } | |
69 return 8; | |
6335
e9bd97d5c5cc
warning & newline fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents:
6026
diff
changeset
|
70 } |