[MPlayer-users] [BUG] Audio only playing burns CPU (was: OGG

Filip Kalinski filon at pld.org.pl
Fri Jan 10 15:18:44 CET 2003


On Tue, Jan 07, 2003 at 10:22:47PM +0100, Arpi wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi,
> 
> > > see get_space() func.
> > > maybe you should add a hack to ao_alsa9.c's get_space:
> > > 
> > > if(space<8192) return 0; else return space;
> > > 
> > > so it will return 'buffer is full' until there is at least 8k free space.
> > 
> > I have mad the change and it's working great for me! CPU usage dropped
> > from 70% to 1.5% :-) Thanks! (i will commit it now)
> 
> you shouldn't commit as-is.
> maybe reduce to 2k and if still helps then commit.
> imho 8k is too much, several cards has 16k total buffer, so waiting until 8k
> gets freed is too long...  mayeb you should query the buffer size and divide
> by 8 and use that limit.

I tested it for various values, and it's enough to return 0 if space is
less than even small number such as 32. The next query just returns
about 3K.
But there are still some chunks left of size < 200, so checking for size < 256
will fix the problem completly and wouldn't break anything (this is really
small size).

Ok to change? (it's simplier that probing the card's buffer, and works).

-- 
Filip Kalinski <filon at pld.org.pl>



More information about the MPlayer-users mailing list