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;
|
|
35 default:
|
|
36 //This can not happen ....
|
|
37 af_msg(AF_MSG_FATAL,"Unrecognized input audio format %i\n",ifmt);
|
|
38 break;
|
|
39 }
|
|
40 return ofmt;
|
|
41 }
|