changeset 28294:94a62675c105

100l, mixed up ao_data.samplerate and ao_data.bps when calculating sleep time. Fixes stuttering audio when playing audio-only files.
author reimar
date Fri, 16 Jan 2009 09:41:26 +0000
parents 86dbf93add87
children 373702f9db03
files mplayer.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Fri Jan 16 09:35:05 2009 +0000
+++ b/mplayer.c	Fri Jan 16 09:41:26 2009 +0000
@@ -2027,7 +2027,7 @@
 	// 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);
     }