[MPlayer-cvslog] r35563 - trunk/libao2/ao_dsound.c

reimar subversion at mplayerhq.hu
Sun Dec 2 22:39:29 CET 2012


Author: reimar
Date: Sun Dec  2 22:39:29 2012
New Revision: 35563

Log:
ao_dsound: Add a hack that avoid cutting of audio,
even when the drivers do not report status correctly.

Modified:
   trunk/libao2/ao_dsound.c

Modified: trunk/libao2/ao_dsound.c
==============================================================================
--- trunk/libao2/ao_dsound.c	Sun Dec  2 16:59:55 2012	(r35562)
+++ trunk/libao2/ao_dsound.c	Sun Dec  2 22:39:29 2012	(r35563)
@@ -568,6 +568,11 @@ static void uninit(int immed)
 	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);
 	}


More information about the MPlayer-cvslog mailing list