[MPlayer-dev-eng] [PATCH] alsa: use buffer_time_min instead of buffer_time_near

Clemens Ladisch clemens at ladisch.de
Tue Sep 29 13:48:27 CEST 2009


Reimar Döffinger wrote:
> using buffer_time_near allows ALSA to (in theory) create ridiculously
> small buffers which MPlayer can not handle at all

Disregarding the bug below, this can happen only if the device does not
actually support any buffer size bigger than that, so we'd only have the
choice between small buffer or failure.

> However I think that r29549 added another bug:
> snd_pcm_hw_params_set_buffer_time_near can modify the alsa_buffer_time,
> so when playing multiple files, the second one will try to set the
> buffer time to near the return value of the last call instead of the
> intended default value, possibly causing it to converge towards 0.

Indeed, although it's more likely to converge to some value near the
original one.

The old code had the same bug regarding the alsa_fragcount and
chunk_size variables, so this doesn't appear to be a problem in
practice.


Best regards,
Clemens



More information about the MPlayer-dev-eng mailing list