Commit 2ff6a9ad authored by Max Kellermann's avatar Max Kellermann

output/wasapi: GetDevice() returns IMMDevice

parent 17d4873b
...@@ -260,7 +260,7 @@ private: ...@@ -260,7 +260,7 @@ private:
void FindExclusiveFormatSupported(AudioFormat &audio_format); void FindExclusiveFormatSupported(AudioFormat &audio_format);
void FindSharedFormatSupported(AudioFormat &audio_format); void FindSharedFormatSupported(AudioFormat &audio_format);
void EnumerateDevices(); void EnumerateDevices();
void GetDevice(unsigned int index); ComPtr<IMMDevice> GetDevice(unsigned int index);
unsigned int SearchDevice(std::string_view name); unsigned int SearchDevice(std::string_view name);
}; };
...@@ -622,7 +622,7 @@ void WasapiOutput::OpenDevice() { ...@@ -622,7 +622,7 @@ void WasapiOutput::OpenDevice() {
device_config.c_str()); device_config.c_str());
} }
GetDevice(id); device = GetDevice(id);
} else { } else {
device = GetDefaultAudioEndpoint(*enumerator); device = GetDefaultAudioEndpoint(*enumerator);
} }
...@@ -828,9 +828,11 @@ void WasapiOutput::EnumerateDevices() { ...@@ -828,9 +828,11 @@ void WasapiOutput::EnumerateDevices() {
} }
/// run inside COMWorkerThread /// run inside COMWorkerThread
void WasapiOutput::GetDevice(unsigned int index) { ComPtr<IMMDevice>
WasapiOutput::GetDevice(unsigned int index)
{
const auto device_collection = EnumAudioEndpoints(*enumerator); const auto device_collection = EnumAudioEndpoints(*enumerator);
device = Item(*device_collection, index); return Item(*device_collection, index);
} }
/// run inside COMWorkerThread /// run inside COMWorkerThread
......
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