summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi.h
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2015-02-22 18:27:58 -0800
committerKevin Mitchell <kevmitch@gmail.com>2015-02-23 14:02:08 -0800
commitc52833bf16c9f4cc2bb676d13df86ef6be30f434 (patch)
treead0662873936d73b5cd32b5e4e706c6d69c88d77 /audio/out/ao_wasapi.h
parent446fd5a43a56f15d7ecec5fb65544adeee0be72f (diff)
downloadmpv-c52833bf16c9f4cc2bb676d13df86ef6be30f434.tar.bz2
mpv-c52833bf16c9f4cc2bb676d13df86ef6be30f434.tar.xz
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
Diffstat (limited to 'audio/out/ao_wasapi.h')
-rwxr-xr-xaudio/out/ao_wasapi.h5
1 files changed, 1 insertions, 4 deletions
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;