diff options
author | Chris Robinson <[email protected]> | 2021-01-10 13:34:05 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-01-10 13:34:05 -0800 |
commit | 1f01311ee3901c31d153a67543c0cbf1475e6e47 (patch) | |
tree | 357f015d464d55a2ec0b1c552b23698e3a018afd | |
parent | 3348d3ce15fad1a4ddb7b31c1f56c46225075f70 (diff) |
Make sure proper names are used for querying PulseAudio info
-rw-r--r-- | alc/backends/pulseaudio.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index f49f65dc..135e3138 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -873,8 +873,8 @@ void PulsePlayback::open(const char *name) mDeviceName = pulse_name ? al::make_optional<std::string>(pulse_name) : al::nullopt; if(!dev_name) { - pa_operation *op{pa_context_get_sink_info_by_name(mContext, pulse_name, - &PulsePlayback::sinkNameCallbackC, this)}; + pa_operation *op{pa_context_get_sink_info_by_name(mContext, + pa_stream_get_device_name(mStream), &PulsePlayback::sinkNameCallbackC, this)}; mMainloop.waitForOperation(op, plock); } else @@ -883,8 +883,8 @@ void PulsePlayback::open(const char *name) bool PulsePlayback::reset() { - const auto deviceName = mDeviceName ? mDeviceName->c_str() : nullptr; auto plock = mMainloop.getUniqueLock(); + const auto deviceName = mDeviceName ? mDeviceName->c_str() : nullptr; if(mStream) { @@ -1280,8 +1280,8 @@ void PulseCapture::open(const char *name) mDeviceName = pulse_name ? al::make_optional<std::string>(pulse_name) : al::nullopt; if(mDevice->DeviceName.empty()) { - pa_operation *op{pa_context_get_source_info_by_name(mContext, pulse_name, - &PulseCapture::sourceNameCallbackC, this)}; + pa_operation *op{pa_context_get_source_info_by_name(mContext, + pa_stream_get_device_name(mStream), &PulseCapture::sourceNameCallbackC, this)}; mMainloop.waitForOperation(op, plock); } } |