[MPlayer-dev-eng] [PATCH] ao_dart

KO Myung-Hun komh at chollian.net
Wed Feb 25 21:02:09 CET 2009


Hi/2.

Reimar Döffinger wrote:
> On Thu, Feb 26, 2009 at 03:29:53AM +0900, KO Myung-Hun wrote:
>   
>> m_fQuit = FALSE;
>>     
>
> I'd move that near where you set m_iBufReadPos/m_iBufWritePos, IMO they
> are related (all used in dart_audio_callback).
>
>   

No problem.

>> +    // multiple of CHUNK_SIZE and one more chunk
>> +    m_nBufSize = ((DART.ulBufferSize << 2) / CHUNK_SIZE) * CHUNK_SIZE + CHUNK_SIZE;
>>     
>
> You need to round up, or you might get a buffer without any space. I.e.
>   
>> m_nBufSize = (((DART.ulBufferSize << 2) + CHUNK_SIZE - 1) / CHUNK_SIZE) * CHUNK_SIZE + CHUNK_SIZE;
>>     
> or just add 2*CHUNK_SIZE at the end or whatever, just make sure
> m_nBufSize < 2*CHUNK_SIZE is not possible.
>
>   

Ok. Added 2 * CHUNK_SIZE.

>> +    if (!immed) {
>> +        while (DART.fPlaying)
>> +            DosSleep(1);
>>     
>
> I'd suggest using usec_sleep.
> Also you could consider if you want to combine it with/instead use the method SDL uses:
> usec_sleep(get_delay() * 1000 * 1000);
> which is quite accurate without needing frequent wakeups.
> E.g. overall
> usec_sleep(get_delay() * 1000 * 1000);
> while (DART.fPlaying)
>   usec_sleep(1000);
> None of these are important though, and maybe not even better, just some suggestions.
>
>   

DosSleep(1) has a special meaning on OS/2. It causes the thread to yield 
its remainder of the current time slice to other thread regardless of 
priority. I prefer this way. ^^

> If nobody else has comments I think it can be committed.
>   

Thanks. ^_____^

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

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


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dart.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090226/2e897671/attachment.asc>


More information about the MPlayer-dev-eng mailing list