[MPlayer-cvslog] r28329 - trunk/mplayer.c

reimar subversion at mplayerhq.hu
Fri Jan 16 10:41:26 CET 2009


Author: reimar
Date: Fri Jan 16 10:41:26 2009
New Revision: 28329

Log:
100l, mixed up ao_data.samplerate and ao_data.bps when calculating sleep time.
Fixes stuttering audio when playing audio-only files.

Modified:
   trunk/mplayer.c

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Fri Jan 16 10:35:05 2009	(r28328)
+++ trunk/mplayer.c	Fri Jan 16 10:41:26 2009	(r28329)
@@ -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);
     }



More information about the MPlayer-cvslog mailing list