mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
61a0220c1a
## Link to GitHub Issue or related Pull Request, if one exists Fixes #782 ## Description of change This addresses an issue only seen on Linux + WINE. Defer retaining WASAPI clients until `Initialize` succeeds. Before this PR, temporary clients created during DirectShow device capability probing were retained as active audio clients, causing Wine/Linux crashes in DDR and popn. Also covers IAudioClient3, dummy, ASIO, WaveOut, and null-device initialization paths, for consistency. ## Testing WIP
20 lines
443 B
C++
20 lines
443 B
C++
#pragma once
|
|
|
|
#include <mutex>
|
|
|
|
#include <windows.h>
|
|
#include <audioclient.h>
|
|
#include "hooks/audio/backends/wasapi/low_latency_client.h"
|
|
|
|
constexpr bool AUDIO_LOG_HRESULT = true;
|
|
|
|
namespace hooks::audio {
|
|
|
|
extern IAudioClient *CLIENT;
|
|
extern std::mutex INITIALIZE_LOCK;
|
|
extern bool VOLUME_HOOK_ENABLED;
|
|
extern LowLatencyAudioClient *LOW_LATENCY_CLIENT;
|
|
|
|
void set_active_client(IAudioClient *client, const char *source);
|
|
}
|