[MPlayer-dev-eng] [PATCH] ao_dart

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Feb 25 20:24:31 CET 2009


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

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

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

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



More information about the MPlayer-dev-eng mailing list