From c52833bf16c9f4cc2bb676d13df86ef6be30f434 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Sun, 22 Feb 2015 18:27:58 -0800 Subject: ao/wasapi: move resume to audio thread This echanges the two events hForceFeed/hFeedDone for hResume. This like the last commit makes things more deterministic. Importantly, the forcefeed is only done if there is not already a full buffer yet to be played by the device. This should fix some of the problems with exclusive mode. This commit also removes the necessity to have a proxy to the AudioClient object in the main thread. fixes #1529 --- audio/out/ao_wasapi.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'audio/out/ao_wasapi.h') diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h index 4923229a4b..2fd266eab0 100755 --- a/audio/out/ao_wasapi.h +++ b/audio/out/ao_wasapi.h @@ -72,8 +72,7 @@ typedef struct wasapi_state { IMMDeviceEnumerator *pEnumerator; HANDLE hFeed; /* wasapi event */ - HANDLE hForceFeed; /* forces writing a buffer (e.g. before audio_resume) */ - HANDLE hFeedDone; /* set only after a hForceFeed */ + HANDLE hResume; /* signal audio thread to resume the stream */ HANDLE hReset; /* signal audio thread to reset the stream */ HANDLE hTask; /* AV thread */ DWORD taskIndex; /* AV task ID */ @@ -81,7 +80,6 @@ typedef struct wasapi_state { /* WASAPI proxy handles, for Single-Threaded Apartment communication. One is needed for each object that's accessed by a different thread. */ - IAudioClient *pAudioClientProxy; ISimpleAudioVolume *pAudioVolumeProxy; IAudioEndpointVolume *pEndpointVolumeProxy; IAudioSessionControl *pSessionControlProxy; @@ -89,7 +87,6 @@ typedef struct wasapi_state { /* Streams used to marshal the proxy objects. The thread owning the actual objects needs to marshal proxy objects into these streams, and the thread that wants the proxies unmarshals them from here. */ - IStream *sAudioClient; IStream *sAudioVolume; IStream *sEndpointVolume; IStream *sSessionControl; -- cgit v1.2.3