# HG changeset patch # User reimar # Date 1354484369 0 # Node ID 539bfa51eb729de6af030f8f1601465977223cd2 # Parent 047fc4746236c7cc94f8b1aaa26036e2110aeff2 ao_dsound: Add a hack that avoid cutting of audio, even when the drivers do not report status correctly. diff -r 047fc4746236 -r 539bfa51eb72 libao2/ao_dsound.c --- a/libao2/ao_dsound.c Sun Dec 02 15:59:55 2012 +0000 +++ b/libao2/ao_dsound.c Sun Dec 02 21:39:29 2012 +0000 @@ -568,6 +568,11 @@ else{ DWORD status; IDirectSoundBuffer_Play(hdsbuf, 0, 0, 0); + // This should not be necessary, but a lot of drivers + // do not correctly report the status here, causing + // audio to be discarded. So we sleep approximately + // the right amount of time first. + usec_sleep(get_delay() * 1000 * 1000); while(!IDirectSoundBuffer_GetStatus(hdsbuf,&status) && (status&DSBSTATUS_PLAYING)) usec_sleep(20000); }