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


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29748 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-10-02 16:49:41 +00:00
parent 2946fb53a7
commit a79706df46
1 changed files with 4 additions and 1 deletions

View File

@ -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);