summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi.h
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-11-17 05:02:18 -0800
committerKevin Mitchell <kevmitch@gmail.com>2014-11-17 05:02:18 -0800
commit313f1954c527e4ff45dbc37a567b2d18d0a6c65b (patch)
tree5e75137dc37b583eaa78f40aead4a56091f82bfc /audio/out/ao_wasapi.h
parentf4804b0c45c4f63ea0f92e9dbaa83f8271beefa5 (diff)
parent4c8b841fc492e21d0c079dc1217424f06beb72b7 (diff)
downloadmpv-313f1954c527e4ff45dbc37a567b2d18d0a6c65b.tar.bz2
mpv-313f1954c527e4ff45dbc37a567b2d18d0a6c65b.tar.xz
Merge branch 'wasapi_fix2'
Diffstat (limited to 'audio/out/ao_wasapi.h')
-rwxr-xr-xaudio/out/ao_wasapi.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h
index 36428b4aea..7e7cc6cd06 100755
--- a/audio/out/ao_wasapi.h
+++ b/audio/out/ao_wasapi.h
@@ -30,12 +30,26 @@
#include "osdep/atomics.h"
+typedef struct change_notify {
+ IMMNotificationClient client; /* this must be first in the structure! */
+ LPWSTR monitored; /* Monitored device */
+ struct ao *ao;
+} change_notify;
+
+HRESULT wasapi_change_init(struct ao* ao);
+void wasapi_change_uninit(struct ao* ao);
+
+#define EXIT_ON_ERROR(hres) \
+ do { if (FAILED(hres)) { goto exit_label; } } while(0)
+#define SAFE_RELEASE(unk, release) \
+ do { if ((unk) != NULL) { release; (unk) = NULL; } } while(0)
+
typedef struct wasapi_state {
struct mp_log *log;
HANDLE threadLoop;
/* Init phase */
- int init_ret;
+ HRESULT init_ret;
HANDLE init_done;
int share_mode;
@@ -62,6 +76,8 @@ typedef struct wasapi_state {
ISimpleAudioVolume *pAudioVolume;
IAudioEndpointVolume *pEndpointVolume;
IAudioSessionControl *pSessionControl;
+ IMMDeviceEnumerator *pEnumerator;
+
HANDLE hFeed; /* wasapi event */
HANDLE hForceFeed; /* forces writing a buffer (e.g. before audio_resume) */
HANDLE hFeedDone; /* set only after a hForceFeed */
@@ -100,6 +116,8 @@ typedef struct wasapi_state {
HANDLE (WINAPI *pAvSetMmThreadCharacteristicsW)(LPCWSTR, LPDWORD);
WINBOOL (WINAPI *pAvRevertMmThreadCharacteristics)(HANDLE);
} VistaBlob;
+
+ change_notify change;
} wasapi_state;
#endif