[MPlayer-cvslog] r29748 - trunk/libao2/ao_alsa.c

reimar subversion at mplayerhq.hu
Fri Oct 2 18:49:42 CEST 2009


Author: reimar
Date: Fri Oct  2 18:49:41 2009
New Revision: 29748

Log:
Make the ao_alsa play function always process a multiple of ao_data.outburst
except for the last chunk.
Should fix high CPU usage reported e.g. here: http://bugs.gentoo.org/show_bug.cgi?id=286020

Modified:
   trunk/libao2/ao_alsa.c

Modified: trunk/libao2/ao_alsa.c
==============================================================================
--- trunk/libao2/ao_alsa.c	Fri Oct  2 10:58:29 2009	(r29747)
+++ trunk/libao2/ao_alsa.c	Fri Oct  2 18:49:41 2009	(r29748)
@@ -763,8 +763,11 @@ static void reset(void)
 
 static int play(void* data, int len, int flags)
 {
-  int num_frames = len / bytes_per_sample;
+  int num_frames;
   snd_pcm_sframes_t res = 0;
+  if (!(flags & AOPLAY_FINAL_CHUNK))
+      len = len / ao_data.outburst * ao_data.outburst;
+  num_frames = len / bytes_per_sample;
 
   //mp_msg(MSGT_AO,MSGL_ERR,"alsa-play: frames=%i, len=%i\n",num_frames,len);
 


More information about the MPlayer-cvslog mailing list