[MPlayer-dev-eng] [PATCH] ao_kai support

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Jan 15 19:46:55 CET 2010


On Sat, Jan 16, 2010 at 01:06:30AM +0900, KO Myung-Hun wrote:
> Hi/2.
> 
> This is a patch for ao_kai support.

So OS/2 is trying hard to compete with the Linux audio mess (constantly
creating a new solution in search of a problem without ever getting at
least one to a working state)?

> +    int nFree = av_fifo_space(m_audioBuf);
> +
> +    if (len > nFree)
> +        len = nFree;

> +    if (len > nBuffered)
> +        len = nBuffered;

FFMIN

However the upper code can cause the amount of data written by play not to be
a multiple of ao_data.outburst (since CHUNK_SIZE might not be a multiple of
outburst), possibly causing serious issues (just imagine 3-channel audio
with the first 2 channels in the buffer and the 3rd being returned to
MPlayer - I suspect that neither MPlayer nor your audio driver will handle
that too well).

> +static ULONG APIENTRY kai_audio_callback(PVOID pCBData, PVOID pBuffer,
> +                                         ULONG ulSize)
> +{
> +    int nReadLen;
> +
> +    nReadLen = read_buffer(pBuffer, ulSize);
> +    if (nReadLen < ulSize && !m_fQuit) {
> +        memset((uint8_t *)pBuffer + nReadLen, m_kaiSpec.bSilence, ulSize - nReadLen);
> +        nReadLen = ulSize;
> +    }
> +
> +    return nReadLen;

Uh, you could just always return ulSize. However if it is such a great
idea to do the underrun handling here instead of letting the audio
driver do something possibly more intelligent is a different question.

> +        {"bufsize", OPT_ARG_INT,  &nSamples, (opt_test_f)int_non_neg},

The cast is not necessary anymore nowadays.

> +    PCSZ pcszAudioDriverStr[] = {"DART", "UNIAUD",};

should be static const. Also since this is only used for mp_msg, just use
char * and the pcsz and Str is a bit much noise in the variable name.

> +    if (!!fUseUniaud + !!fUseDart > 1)

fUseUniaud && fUseDart



More information about the MPlayer-dev-eng mailing list