annotate libaf/af_mp.c @ 8236:7e2ca93330d0

forgotten mangle patch by (Bj«Órn Sandell <biorn at dce dot chalmers dot se>)
author michael
date Tue, 19 Nov 2002 23:35:51 +0000
parents 1205e37a3ab2
children 2369087bb777
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8167
e8832e66babd New features:
anders
parents:
diff changeset
1 #include "af.h"
e8832e66babd New features:
anders
parents:
diff changeset
2
e8832e66babd New features:
anders
parents:
diff changeset
3 /* Decodes the format from mplayer format to libaf format */
e8832e66babd New features:
anders
parents:
diff changeset
4 int af_format_decode(int ifmt)
e8832e66babd New features:
anders
parents:
diff changeset
5 {
e8832e66babd New features:
anders
parents:
diff changeset
6 int ofmt = ~0;
e8832e66babd New features:
anders
parents:
diff changeset
7 // Check input ifmt
e8832e66babd New features:
anders
parents:
diff changeset
8 switch(ifmt){
e8832e66babd New features:
anders
parents:
diff changeset
9 case(AFMT_U8):
e8832e66babd New features:
anders
parents:
diff changeset
10 ofmt = AF_FORMAT_LE|AF_FORMAT_US; break;
e8832e66babd New features:
anders
parents:
diff changeset
11 case(AFMT_S8):
e8832e66babd New features:
anders
parents:
diff changeset
12 ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break;
e8832e66babd New features:
anders
parents:
diff changeset
13 case(AFMT_S16_LE):
e8832e66babd New features:
anders
parents:
diff changeset
14 ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break;
e8832e66babd New features:
anders
parents:
diff changeset
15 case(AFMT_S16_BE):
e8832e66babd New features:
anders
parents:
diff changeset
16 ofmt = AF_FORMAT_BE|AF_FORMAT_SI; break;
e8832e66babd New features:
anders
parents:
diff changeset
17 case(AFMT_U16_LE):
e8832e66babd New features:
anders
parents:
diff changeset
18 ofmt = AF_FORMAT_LE|AF_FORMAT_US; break;
e8832e66babd New features:
anders
parents:
diff changeset
19 case(AFMT_U16_BE):
e8832e66babd New features:
anders
parents:
diff changeset
20 ofmt = AF_FORMAT_BE|AF_FORMAT_US; break;
e8832e66babd New features:
anders
parents:
diff changeset
21 case(AFMT_S32_LE):
e8832e66babd New features:
anders
parents:
diff changeset
22 ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break;
e8832e66babd New features:
anders
parents:
diff changeset
23 case(AFMT_S32_BE):
e8832e66babd New features:
anders
parents:
diff changeset
24 ofmt = AF_FORMAT_BE|AF_FORMAT_SI; break;
e8832e66babd New features:
anders
parents:
diff changeset
25 case(AFMT_IMA_ADPCM):
e8832e66babd New features:
anders
parents:
diff changeset
26 ofmt = AF_FORMAT_IMA_ADPCM; break;
e8832e66babd New features:
anders
parents:
diff changeset
27 case(AFMT_MU_LAW):
e8832e66babd New features:
anders
parents:
diff changeset
28 ofmt = AF_FORMAT_MU_LAW; break;
e8832e66babd New features:
anders
parents:
diff changeset
29 case(AFMT_A_LAW):
e8832e66babd New features:
anders
parents:
diff changeset
30 ofmt = AF_FORMAT_A_LAW; break;
e8832e66babd New features:
anders
parents:
diff changeset
31 case(AFMT_MPEG):
e8832e66babd New features:
anders
parents:
diff changeset
32 ofmt = AF_FORMAT_MPEG2; break;
e8832e66babd New features:
anders
parents:
diff changeset
33 case(AFMT_AC3):
e8832e66babd New features:
anders
parents:
diff changeset
34 ofmt = AF_FORMAT_AC3; break;
8233
1205e37a3ab2 Adding support for AFMT_FLOAT
anders
parents: 8167
diff changeset
35 case(AFMT_FLOAT):
1205e37a3ab2 Adding support for AFMT_FLOAT
anders
parents: 8167
diff changeset
36 ofmt = AF_FORMAT_F; break;
8167
e8832e66babd New features:
anders
parents:
diff changeset
37 default:
e8832e66babd New features:
anders
parents:
diff changeset
38 //This can not happen ....
e8832e66babd New features:
anders
parents:
diff changeset
39 af_msg(AF_MSG_FATAL,"Unrecognized input audio format %i\n",ifmt);
e8832e66babd New features:
anders
parents:
diff changeset
40 break;
e8832e66babd New features:
anders
parents:
diff changeset
41 }
e8832e66babd New features:
anders
parents:
diff changeset
42 return ofmt;
e8832e66babd New features:
anders
parents:
diff changeset
43 }