Commit 56866554 authored by Thomas Guillem's avatar Thomas Guillem

mmdevice: support WASAPI device endpoint activation events

Some devices expose more than one endpoint such as speakers and headphone
output. Disconnecting headphones does not remove the endpoint but instead marks
it as being in unplugged state.

Respond to the appropriate activation events in order to enable/disable
endpoints correctly when they are added/removed from set of "active" endpoints.

Fix #15966

Original patch by Sean McGovern <gseanmcg@gmail.com>
parent 3e506d2e
......@@ -619,7 +619,7 @@ vlc_MMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *this,
break;
case DEVICE_STATE_ACTIVE:
msg_Dbg(aout, "device %ls state changed: active", wid);
break;
return DeviceUpdated(aout, wid);
case DEVICE_STATE_DISABLED:
msg_Dbg(aout, "device %ls state changed: disabled", wid);
break;
......@@ -628,9 +628,16 @@ vlc_MMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *this,
break;
default:
msg_Dbg(aout, "device %ls state changed: unknown: %08lx", wid, state);
break;
return E_FAIL;
}
/* Unplugged, disabled or notpresent */
char *id = FromWide(wid);
if (unlikely(id == NULL))
return E_OUTOFMEMORY;
aout_HotplugReport(aout, id, NULL);
free(id);
return S_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment