fixed newly arisen race cons (busywaits)
This commit is contained in:
parent
109330dbbd
commit
53f9506115
4 changed files with 59 additions and 11 deletions
|
|
@ -119,11 +119,13 @@ class EndpointVolumeCallback : public IAudioEndpointVolumeCallback {
|
|||
HRESULT QueryInterface(REFIID riid, VOID **ppvInterface);
|
||||
HRESULT OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA update);
|
||||
void updateVolumeInfo(AUDIO_VOLUME_NOTIFICATION_DATA newVolume, float* channelVolumes);
|
||||
void reportFinished();
|
||||
//~EndpointVolumeCallback();
|
||||
|
||||
private:
|
||||
ULONG ref = 1;
|
||||
Endpoint* ep;
|
||||
bool wait = false;
|
||||
};
|
||||
|
||||
class EndpointSituationCallback : public IMMNotificationClient {
|
||||
|
|
@ -137,10 +139,11 @@ class EndpointSituationCallback : public IMMNotificationClient {
|
|||
HRESULT OnDeviceRemoved(LPCWSTR pwstrDeviceId);
|
||||
HRESULT OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState);
|
||||
HRESULT OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key);
|
||||
|
||||
void reportFinishedStateChange();
|
||||
private:
|
||||
ULONG ref = 1;
|
||||
Overseer* os;
|
||||
bool isEpStateChanging = false;
|
||||
};
|
||||
|
||||
class Overseer {
|
||||
|
|
@ -156,6 +159,8 @@ class Overseer {
|
|||
|
||||
void createEndpoints(Flows flow);
|
||||
Endpoint* addEndpoint(std::wstring endpointId, /* out */ Flows* flow);
|
||||
|
||||
void reportFinishedStateChange();
|
||||
|
||||
std::mutex playbackMutex;
|
||||
std::mutex captureMutex;
|
||||
|
|
@ -196,9 +201,10 @@ class EndpointNewSessionCallback : public IAudioSessionNotification {
|
|||
ULONG Release();
|
||||
HRESULT QueryInterface(REFIID riid, VOID **ppvInterface);
|
||||
HRESULT OnSessionCreated(IAudioSessionControl *NewSession);
|
||||
static void createSessionThread(SessionThreadParams params);
|
||||
void createSessionThread(SessionThreadParams params);
|
||||
|
||||
private:
|
||||
bool wait = false;
|
||||
ULONG ref = 1;
|
||||
EndpointHandler *eph;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue