0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00

100l, mixed up ao_data.samplerate and ao_data.bps when calculating sleep time.

Fixes stuttering audio when playing audio-only files.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28329 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-01-16 09:41:26 +00:00
parent 3983898734
commit 9dee994c23

View File

@ -2027,7 +2027,7 @@ static int fill_audio_out_buffers(void)
// handle audio-only case:
// this is where mplayer sleeps during audio-only playback
// to avoid 100% CPU use
sleep_time = (ao_data.outburst - bytes_to_write) * 1000 / ao_data.samplerate;
sleep_time = (ao_data.outburst - bytes_to_write) * 1000 / ao_data.bps;
if (sleep_time < 10) sleep_time = 10; // limit to 100 wakeups per second
usec_sleep(sleep_time * 1000);
}