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

Arpi arpi at thot.banki.hu
Tue Jan 7 22:22:47 CET 2003


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.

> > > Also, seeking in video files with no video (in audio files it works)
> > > makes mplayer crash is mpg and avi files (and probably others).
> > > 
> > > Tthe problem of segfaults is that there are unconditional references to
> > > sh_video which is NULL in these cases. But just ignoring references to
> > > sh_video only fixes segfaulting, not seeking, I don't know demuxers code
> > > that good to fix it :-(
> > 
> > send gdb logs to me, esp. about where are those unconditional sh_video
> > references. the OSD should be disabled for audio-only files.
> 
> Huh? What do have OSD to do with the case I described?
it's tricky.
instead of adding hundreds of if(sh_video!=NULL) around all the OSD stuff
in mplayer.c, there is a hack to disable OSD (osdlevel=0) for audio-only
files, so these codes aren't executed at all.

> Anyway, I have prepared gdb output, but the bugs are easy to spot.
> Demuxers are just not designed to use without video stream.
it depends.

> In demux_avi there is:
yes, avi means audio+video interleaved.
the fileformat really isn't for audio-only.
i've never ever seen any audio-only avi, proabbly because no such thing
exists.

> in demux_mpeg:

mpeg-ps and mpeg-es are another video-only files.

there is demux_audio.c for mpeg audio.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-users mailing list