mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
Fix ao_null with float samples
ao_null accepts float input, but the code calculating ao_data.bps only checked for 1-byte formats and used samplesize 2 for everything else. Because ao_null uses the bps value in its timing calculations this effectively made "playback" advance at half the correct speed. Fixed by calculating samplesize with af_fmt2bits() instead. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25223 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
7e5c327c5a
commit
a655984828
@ -50,7 +50,7 @@ static int control(int cmd,void *arg){
|
||||
// return: 1=success 0=fail
|
||||
static int init(int rate,int channels,int format,int flags){
|
||||
|
||||
int samplesize = (format == AF_FORMAT_U8 || format == AF_FORMAT_S8) ? 1: 2;
|
||||
int samplesize = af_fmt2bits(format) / 8;
|
||||
ao_data.outburst = 256 * channels * samplesize;
|
||||
// A "buffer" for about 0.2 seconds of audio
|
||||
ao_data.buffersize = (int)(rate * 0.2 / 256 + 1) * ao_data.outburst;
|
||||
|
Loading…
Reference in New Issue
Block a user