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

KO Myung-Hun komh at chollian.net
Sat Jan 16 15:54:28 CET 2010


Hi/2.

Reimar Döffinger wrote:
> 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)?
>

Unfortunately. T.T

Nevertheless, it's fortunate that libkai is a unified interface for a 
various audio implementation.


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

Fixed.

>> +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.
>

The caller treats underrun(nReadLen < ulSize) as a end of stream. And 
m_fQuit is set to TRUE in uninit(). So if !immed, callback can return 
nReadLen less than ulSize. As a result, MPlayer can wait until the last 
chunk can be played.

>> +        {"bufsize", OPT_ARG_INT,&nSamples, (opt_test_f)int_non_neg},
>
> The cast is not necessary anymore nowadays.
>

Ok.

>> +    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.
>

Ok.

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

Fixed.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0
Under OS/2 Warp 4 for Korean with FixPak #15
On Intel Core2Duo T5500 1.66 GHz with 1 GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ao_kai.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100116/80b455e6/attachment.asc>


More information about the MPlayer-dev-eng mailing list