Mercurial > mplayer.hg
annotate libaf/af_mp.c @ 8977:5c7d92600018
10l found by Arpi (njamd)
author | pontscho |
---|---|
date | Sat, 18 Jan 2003 00:22:18 +0000 |
parents | 2369087bb777 |
children | a6615e7bc710 |
rev | line source |
---|---|
8167 | 1 #include "af.h" |
2 | |
3 /* Decodes the format from mplayer format to libaf format */ | |
4 int af_format_decode(int ifmt) | |
5 { | |
6 int ofmt = ~0; | |
7 // Check input ifmt | |
8 switch(ifmt){ | |
9 case(AFMT_U8): | |
10 ofmt = AF_FORMAT_LE|AF_FORMAT_US; break; | |
11 case(AFMT_S8): | |
12 ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break; | |
13 case(AFMT_S16_LE): | |
14 ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break; | |
15 case(AFMT_S16_BE): | |
16 ofmt = AF_FORMAT_BE|AF_FORMAT_SI; break; | |
17 case(AFMT_U16_LE): | |
18 ofmt = AF_FORMAT_LE|AF_FORMAT_US; break; | |
19 case(AFMT_U16_BE): | |
20 ofmt = AF_FORMAT_BE|AF_FORMAT_US; break; | |
21 case(AFMT_S32_LE): | |
22 ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break; | |
23 case(AFMT_S32_BE): | |
24 ofmt = AF_FORMAT_BE|AF_FORMAT_SI; break; | |
25 case(AFMT_IMA_ADPCM): | |
26 ofmt = AF_FORMAT_IMA_ADPCM; break; | |
27 case(AFMT_MU_LAW): | |
28 ofmt = AF_FORMAT_MU_LAW; break; | |
29 case(AFMT_A_LAW): | |
30 ofmt = AF_FORMAT_A_LAW; break; | |
31 case(AFMT_MPEG): | |
32 ofmt = AF_FORMAT_MPEG2; break; | |
33 case(AFMT_AC3): | |
34 ofmt = AF_FORMAT_AC3; break; | |
8233 | 35 case(AFMT_FLOAT): |
8952
2369087bb777
Fix for endianess conversion if input to libaf is float
anders
parents:
8233
diff
changeset
|
36 ofmt = AF_FORMAT_F | AF_FORMAT_NE; break; |
8167 | 37 default: |
38 //This can not happen .... | |
39 af_msg(AF_MSG_FATAL,"Unrecognized input audio format %i\n",ifmt); | |
40 break; | |
41 } | |
42 return ofmt; | |
43 } |