From d1cbff37be885108808c27311d79422dc0cb4a7f Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Fri, 18 Dec 2015 21:11:42 -0800 Subject: 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. --- audio/out/ao_wasapi_utils.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'audio/out/ao_wasapi_utils.c') 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)); -- cgit v1.2.3