summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi_utils.c
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2015-11-24 04:25:01 -0800
committerKevin Mitchell <kevmitch@gmail.com>2015-11-24 04:42:37 -0800
commit00b7fb30237365a530b47d451833f9b53b2bf6b9 (patch)
tree4d80b1a06b015826599b656f0a6d34271e91af06 /audio/out/ao_wasapi_utils.c
parent4f103b209312ca8fa1471fc09ebb15c273f818b8 (diff)
downloadmpv-00b7fb30237365a530b47d451833f9b53b2bf6b9.tar.bz2
mpv-00b7fb30237365a530b47d451833f9b53b2bf6b9.tar.xz
ao_wasapi: get rid of Vistablob hack
This was required to work around XP linking issues and is no longer required.
Diffstat (limited to 'audio/out/ao_wasapi_utils.c')
-rwxr-xr-xaudio/out/ao_wasapi_utils.c41
1 files changed, 5 insertions, 36 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c
index 108db17d32..be81f0e730 100755
--- a/audio/out/ao_wasapi_utils.c
+++ b/audio/out/ao_wasapi_utils.c
@@ -185,36 +185,6 @@ char *mp_HRESULT_to_str_buf(char *buf, size_t buf_size, HRESULT hr)
wasapi_explain_err(hr), (uint32_t) hr);
return buf;
}
-
-bool wasapi_fill_VistaBlob(wasapi_state *state)
-{
- if (!state)
- goto exit_label;
- state->VistaBlob.hAvrt = LoadLibraryW(L"avrt.dll");
- if (!state->VistaBlob.hAvrt)
- goto exit_label;
-
- state->VistaBlob.pAvSetMmThreadCharacteristicsW =
- (HANDLE (WINAPI *)(LPCWSTR, LPDWORD))
- GetProcAddress(state->VistaBlob.hAvrt, "AvSetMmThreadCharacteristicsW");
- if (!state->VistaBlob.pAvSetMmThreadCharacteristicsW)
- goto exit_label;
-
- state->VistaBlob.pAvRevertMmThreadCharacteristics =
- (WINBOOL (WINAPI *)(HANDLE))
- GetProcAddress(state->VistaBlob.hAvrt, "AvRevertMmThreadCharacteristics");
- if (!state->VistaBlob.pAvRevertMmThreadCharacteristics)
- goto exit_label;
-
- return true;
-exit_label:
- if (state->VistaBlob.hAvrt) {
- FreeLibrary(state->VistaBlob.hAvrt);
- state->VistaBlob.hAvrt = NULL;
- }
- return false;
-}
-
static void update_waveformat_datarate(WAVEFORMATEXTENSIBLE *wformat)
{
WAVEFORMATEX *wf = &wformat->Format;
@@ -738,9 +708,10 @@ reinit:
hr = init_session_display(state);
EXIT_ON_ERROR(hr);
- if (state->VistaBlob.hAvrt) {
- state->hTask =
- state->VistaBlob.pAvSetMmThreadCharacteristicsW(L"Pro Audio", &state->taskIndex);
+ state->hTask = AvSetMmThreadCharacteristics(L"Pro Audio", &(DWORD){0});
+ if (!state->hTask) {
+ MP_WARN(state, "Failed to set AV thread to Pro Audio: %s\n",
+ mp_LastError_to_str());
}
MP_VERBOSE(state, "Format fixed. Using %lld byte buffer block size\n",
@@ -1194,8 +1165,6 @@ void wasapi_thread_uninit(struct ao *ao)
SAFE_RELEASE(state->pAudioClient, IAudioClient_Release(state->pAudioClient));
SAFE_RELEASE(state->pDevice, IMMDevice_Release(state->pDevice));
SAFE_RELEASE(state->pEnumerator, IMMDeviceEnumerator_Release(state->pEnumerator));
-
- if (state->hTask)
- state->VistaBlob.pAvRevertMmThreadCharacteristics(state->hTask);
+ SAFE_RELEASE(state->hTask, AvRevertMmThreadCharacteristics(state->hTask));
MP_DBG(ao, "Thread uninit done\n");
}