[MPlayer-cvslog] CVS: main/libaf af_format.c,1.18,1.19
Roberto Togni CVS
syncmail at mplayerhq.hu
Tue Dec 28 03:00:26 CET 2004
CVS change done by Roberto Togni CVS
Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv28368
Modified Files:
af_format.c
Log Message:
100l use right mask type when checking for input format
Index: af_format.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_format.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- af_format.c 27 Dec 2004 19:47:33 -0000 1.18
+++ af_format.c 28 Dec 2004 02:00:23 -0000 1.19
@@ -281,22 +281,19 @@
endian(c->audio,c->audio,len,c->bps);
// Conversion table
- switch(c->format & ~AF_FORMAT_END_MASK){
- case(AF_FORMAT_MU_LAW):
+ if((c->format & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_MU_LAW) {
from_ulaw(c->audio, l->audio, len, l->bps, l->format&AF_FORMAT_POINT_MASK);
if(AF_FORMAT_A_LAW == (l->format&AF_FORMAT_SPECIAL_MASK))
to_ulaw(l->audio, l->audio, len, 1, AF_FORMAT_SI);
if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US)
si2us(l->audio,l->audio,len,l->bps);
- break;
- case(AF_FORMAT_A_LAW):
+ } else if((c->format & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_A_LAW) {
from_alaw(c->audio, l->audio, len, l->bps, l->format&AF_FORMAT_POINT_MASK);
if(AF_FORMAT_A_LAW == (l->format&AF_FORMAT_SPECIAL_MASK))
to_alaw(l->audio, l->audio, len, 1, AF_FORMAT_SI);
if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US)
si2us(l->audio,l->audio,len,l->bps);
- break;
- case(AF_FORMAT_F):
+ } else if((c->format & AF_FORMAT_POINT_MASK) == AF_FORMAT_F) {
switch(l->format&AF_FORMAT_SPECIAL_MASK){
case(AF_FORMAT_MU_LAW):
to_ulaw(c->audio, l->audio, len, c->bps, c->format&AF_FORMAT_POINT_MASK);
@@ -310,8 +307,7 @@
si2us(l->audio,l->audio,len,l->bps);
break;
}
- break;
- default:
+ } else {
// Input must be int
// Change signed/unsigned
@@ -340,7 +336,6 @@
memcpy(l->audio,c->audio,len*c->bps);
break;
}
- break;
}
// Switch from cpu native endian to the correct endianess
More information about the MPlayer-cvslog
mailing list