mirror of https://github.com/mpv-player/mpv
100l use right mask type when checking for input format
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14262 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
3fda49a8cb
commit
c3d77725cc
|
@ -281,22 +281,19 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
|
||||||
endian(c->audio,c->audio,len,c->bps);
|
endian(c->audio,c->audio,len,c->bps);
|
||||||
|
|
||||||
// Conversion table
|
// Conversion table
|
||||||
switch(c->format & ~AF_FORMAT_END_MASK){
|
if((c->format & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_MU_LAW) {
|
||||||
case(AF_FORMAT_MU_LAW):
|
|
||||||
from_ulaw(c->audio, l->audio, len, l->bps, l->format&AF_FORMAT_POINT_MASK);
|
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))
|
if(AF_FORMAT_A_LAW == (l->format&AF_FORMAT_SPECIAL_MASK))
|
||||||
to_ulaw(l->audio, l->audio, len, 1, AF_FORMAT_SI);
|
to_ulaw(l->audio, l->audio, len, 1, AF_FORMAT_SI);
|
||||||
if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US)
|
if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US)
|
||||||
si2us(l->audio,l->audio,len,l->bps);
|
si2us(l->audio,l->audio,len,l->bps);
|
||||||
break;
|
} else if((c->format & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_A_LAW) {
|
||||||
case(AF_FORMAT_A_LAW):
|
|
||||||
from_alaw(c->audio, l->audio, len, l->bps, l->format&AF_FORMAT_POINT_MASK);
|
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))
|
if(AF_FORMAT_A_LAW == (l->format&AF_FORMAT_SPECIAL_MASK))
|
||||||
to_alaw(l->audio, l->audio, len, 1, AF_FORMAT_SI);
|
to_alaw(l->audio, l->audio, len, 1, AF_FORMAT_SI);
|
||||||
if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US)
|
if((l->format&AF_FORMAT_SIGN_MASK) == AF_FORMAT_US)
|
||||||
si2us(l->audio,l->audio,len,l->bps);
|
si2us(l->audio,l->audio,len,l->bps);
|
||||||
break;
|
} else if((c->format & AF_FORMAT_POINT_MASK) == AF_FORMAT_F) {
|
||||||
case(AF_FORMAT_F):
|
|
||||||
switch(l->format&AF_FORMAT_SPECIAL_MASK){
|
switch(l->format&AF_FORMAT_SPECIAL_MASK){
|
||||||
case(AF_FORMAT_MU_LAW):
|
case(AF_FORMAT_MU_LAW):
|
||||||
to_ulaw(c->audio, l->audio, len, c->bps, c->format&AF_FORMAT_POINT_MASK);
|
to_ulaw(c->audio, l->audio, len, c->bps, c->format&AF_FORMAT_POINT_MASK);
|
||||||
|
@ -310,8 +307,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
|
||||||
si2us(l->audio,l->audio,len,l->bps);
|
si2us(l->audio,l->audio,len,l->bps);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
// Input must be int
|
// Input must be int
|
||||||
|
|
||||||
// Change signed/unsigned
|
// Change signed/unsigned
|
||||||
|
@ -340,7 +336,6 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
|
||||||
memcpy(l->audio,c->audio,len*c->bps);
|
memcpy(l->audio,c->audio,len*c->bps);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch from cpu native endian to the correct endianess
|
// Switch from cpu native endian to the correct endianess
|
||||||
|
|
Loading…
Reference in New Issue