Use COM smart pointers to handle COM objects safely
Use ComPtr to handle COM objects safely Use COM smart pointers in WASAPI driver Fix ComPtr handling Fix crash due to IAudioClient3 type conversion
This commit is contained in:
@ -40,15 +40,18 @@
|
||||
|
||||
#include <audioclient.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <wrl/client.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
class AudioDriverWASAPI : public AudioDriver {
|
||||
class AudioDeviceWASAPI {
|
||||
public:
|
||||
IAudioClient *audio_client = nullptr;
|
||||
IAudioRenderClient *render_client = nullptr; // Output
|
||||
IAudioCaptureClient *capture_client = nullptr; // Input
|
||||
ComPtr<IAudioClient> audio_client = nullptr;
|
||||
ComPtr<IAudioRenderClient> render_client = nullptr; // Output
|
||||
ComPtr<IAudioCaptureClient> capture_client = nullptr; // Input
|
||||
SafeFlag active;
|
||||
|
||||
WORD format_tag = 0;
|
||||
|
||||
Reference in New Issue
Block a user