[MPlayer-dev-eng] ao_plugin assumption about ao driver play()
Anders Johansson
ajh at atri.curtin.edu.au
Mon Dec 10 15:28:55 CET 2001
Hi,
> On Mon, 10 Dec 2001, Stephen Davies wrote:
>
> > With that all said, though, I need to think some more about the right
> > fix. I don't think I understand the bug properly.
>
> Aha.
>
> Just saw that ao_oss.c play() cuts the written length to a multiple of the
> fragment size. This will be because OSS docs strongly recommend writing
> only full fragments if you want to keep sync. DSP_GETODELAY may only have
> precision to within one complete fragment...
>
> I also now understand why this doesn't usually cause a problem.
> MAX_OUTBURST of 65536 is a multiple of common fragment sizes. As things
> start with mplaer.c writing an integral number of fragments (ie,
> MAX_OUTBURST), the free space in the oss driver stays as an integral
> number of fragments (fragments always become free as a whole).
>
> I adjusted MAX_OUTBURST to 73728 - a multiple of 12288 and 8192, and
> solved the underflow problem.
>
> But somehow I don't think that this is a proper fix...
>
> Steve
>
One way to fix it would be to ask for the maximum outburst through the
control interface:
max_outburst=audio_out->control(AOCONTROL_GET_VOLUME,MAX_OUTBURST);
the value returned should be less than MAX_OUTBURST. The funcition
could be called somewhere after audio_out->init(). This would however
require a new global variable in mplayer.c, and changes in all the
audioo drivers. A good thing would be that the plugins could affect
the value of max_outburst.
Just an idea. Are you up to it Steve?
//Anders
More information about the MPlayer-dev-eng
mailing list