mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 13:55:38 +00:00
Qt: Fix incorrect minimum latency display
This commit is contained in:
parent
a4a35b7e58
commit
c803c4fbef
|
@ -209,7 +209,8 @@ void AudioSettingsWidget::updateDeviceNames()
|
|||
const AudioBackend backend = getEffectiveBackend();
|
||||
const std::string driver_name = m_dialog->getEffectiveStringValue("Audio", "Driver", "");
|
||||
const std::string current_device = m_dialog->getEffectiveStringValue("Audio", "Device", "");
|
||||
const std::vector<AudioStream::DeviceInfo> devices = AudioStream::GetOutputDevices(backend, driver_name.c_str());
|
||||
const std::vector<AudioStream::DeviceInfo> devices =
|
||||
AudioStream::GetOutputDevices(backend, driver_name.c_str(), SPU::SAMPLE_RATE);
|
||||
|
||||
m_ui.outputDevice->disconnect();
|
||||
m_ui.outputDevice->clear();
|
||||
|
|
|
@ -88,14 +88,14 @@ std::vector<std::pair<std::string, std::string>> AudioStream::GetDriverNames(Aud
|
|||
return ret;
|
||||
}
|
||||
|
||||
std::vector<AudioStream::DeviceInfo> AudioStream::GetOutputDevices(AudioBackend backend, const char* driver)
|
||||
std::vector<AudioStream::DeviceInfo> AudioStream::GetOutputDevices(AudioBackend backend, const char* driver, u32 sample_rate)
|
||||
{
|
||||
std::vector<AudioStream::DeviceInfo> ret;
|
||||
switch (backend)
|
||||
{
|
||||
#ifndef __ANDROID__
|
||||
case AudioBackend::Cubeb:
|
||||
ret = GetCubebOutputDevices(driver);
|
||||
ret = GetCubebOutputDevices(driver, sample_rate);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ public:
|
|||
void SetStretchMode(AudioStretchMode mode);
|
||||
|
||||
static std::vector<std::pair<std::string, std::string>> GetDriverNames(AudioBackend backend);
|
||||
static std::vector<DeviceInfo> GetOutputDevices(AudioBackend backend, const char* driver);
|
||||
static std::vector<DeviceInfo> GetOutputDevices(AudioBackend backend, const char* driver, u32 sample_rate);
|
||||
static std::unique_ptr<AudioStream> CreateStream(AudioBackend backend, u32 sample_rate,
|
||||
const AudioStreamParameters& parameters, const char* driver_name,
|
||||
const char* device_name, Error* error = nullptr);
|
||||
|
@ -242,7 +242,7 @@ private:
|
|||
|
||||
#ifndef __ANDROID__
|
||||
static std::vector<std::pair<std::string, std::string>> GetCubebDriverNames();
|
||||
static std::vector<DeviceInfo> GetCubebOutputDevices(const char* driver);
|
||||
static std::vector<DeviceInfo> GetCubebOutputDevices(const char* driver, u32 sample_rate);
|
||||
static std::unique_ptr<AudioStream> CreateCubebAudioStream(u32 sample_rate, const AudioStreamParameters& parameters,
|
||||
const char* driver_name, const char* device_name,
|
||||
Error* error);
|
||||
|
|
|
@ -311,7 +311,7 @@ std::vector<std::pair<std::string, std::string>> AudioStream::GetCubebDriverName
|
|||
return names;
|
||||
}
|
||||
|
||||
std::vector<AudioStream::DeviceInfo> AudioStream::GetCubebOutputDevices(const char* driver)
|
||||
std::vector<AudioStream::DeviceInfo> AudioStream::GetCubebOutputDevices(const char* driver, u32 sample_rate)
|
||||
{
|
||||
std::vector<AudioStream::DeviceInfo> ret;
|
||||
ret.emplace_back(std::string(), TRANSLATE_STR("AudioStream", "Default"), 0);
|
||||
|
@ -339,7 +339,7 @@ std::vector<AudioStream::DeviceInfo> AudioStream::GetCubebOutputDevices(const ch
|
|||
// we need stream parameters to query latency
|
||||
cubeb_stream_params params = {};
|
||||
params.format = CUBEB_SAMPLE_S16LE;
|
||||
params.rate = 48000;
|
||||
params.rate = sample_rate;
|
||||
params.channels = 2;
|
||||
params.layout = CUBEB_LAYOUT_UNDEFINED;
|
||||
params.prefs = CUBEB_STREAM_PREF_NONE;
|
||||
|
|
Loading…
Reference in a new issue