1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00

fix calculation of ao_data.bps for sample formats with more than 16 bits

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29750 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
cladisch 2009-10-05 07:42:02 +00:00
parent 23235a0ed0
commit 59b6e1393d

View File

@ -396,8 +396,19 @@ ac3_retry:
}
ao_data.bps=ao_data.channels;
if(ao_data.format != AF_FORMAT_U8 && ao_data.format != AF_FORMAT_S8)
switch (ao_data.format & AF_FORMAT_BITS_MASK) {
case AF_FORMAT_8BIT:
break;
case AF_FORMAT_16BIT:
ao_data.bps*=2;
break;
case AF_FORMAT_24BIT:
ao_data.bps*=3;
break;
case AF_FORMAT_32BIT:
ao_data.bps*=4;
break;
}
ao_data.outburst-=ao_data.outburst % ao_data.bps; // round down
ao_data.bps*=ao_data.samplerate;