diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2015-12-18 21:11:42 -0800 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2015-12-20 03:30:28 -0800 |
commit | d1cbff37be885108808c27311d79422dc0cb4a7f (patch) | |
tree | d87fef09e7d0f8cf9e5e77acea8c43995302b093 /audio/out/ao_wasapi_utils.c | |
parent | aa5f04c7a0b1f809f47a3aef48654a9b8788e8cb (diff) | |
download | mpv-d1cbff37be885108808c27311d79422dc0cb4a7f.tar.bz2 mpv-d1cbff37be885108808c27311d79422dc0cb4a7f.tar.xz |
ao_wasapi: remove volume "restore" on exit
It was complicated and not even very intuitive to the user.
If you are controlling the master volume, you just have to be
prepared to deal with the consequences.
Diffstat (limited to 'audio/out/ao_wasapi_utils.c')
-rwxr-xr-x | audio/out/ao_wasapi_utils.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index 2ffaa31c17..20729b2348 100755 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -1057,8 +1057,7 @@ HRESULT wasapi_thread_init(struct ao *ao) struct wasapi_state *state = ao->priv; MP_DBG(ao, "Init wasapi thread\n"); int64_t retry_wait = 1; -retry: - state->initial_volume = -1.0; +retry: ; HRESULT hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &IID_IMMDeviceEnumerator, (void **)&state->pEnumerator); @@ -1122,16 +1121,6 @@ retry: hr = create_proxies(state); EXIT_ON_ERROR(hr); - MP_DBG(ao, "Read volume levels\n"); - if (state->opt_exclusive) { - IAudioEndpointVolume_GetMasterVolumeLevelScalar(state->pEndpointVolume, - &state->initial_volume); - } else { - ISimpleAudioVolume_GetMasterVolume(state->pAudioVolume, - &state->initial_volume); - } - state->previous_volume = state->initial_volume; - wasapi_change_init(ao, false); MP_DBG(ao, "Init wasapi thread done\n"); @@ -1151,11 +1140,6 @@ void wasapi_thread_uninit(struct ao *ao) IAudioClient_Stop(state->pAudioClient); wasapi_change_uninit(ao); - - if (state->opt_exclusive && state->pEndpointVolume && state->initial_volume > 0 ) { - IAudioEndpointVolume_SetMasterVolumeLevelScalar(state->pEndpointVolume, - state->initial_volume, NULL); - } destroy_proxies(state); SAFE_RELEASE(state->pRenderClient, IAudioRenderClient_Release(state->pRenderClient)); |