Centralize logic to detect when the DPL2 decoder should be used.
This commit is contained in:
parent
2ff646b796
commit
08787ebc4a
|
@ -37,7 +37,7 @@ bool CubebStream::Init()
|
||||||
if (!m_ctx)
|
if (!m_ctx)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_stereo = !SConfig::GetInstance().bDPL2Decoder || SConfig::GetInstance().bDSPHLE;
|
m_stereo = !SConfig::GetInstance().ShouldUseDPL2Decoder();
|
||||||
|
|
||||||
cubeb_stream_params params;
|
cubeb_stream_params params;
|
||||||
params.rate = m_mixer->GetSampleRate();
|
params.rate = m_mixer->GetSampleRate();
|
||||||
|
|
|
@ -221,8 +221,7 @@ void OpenALStream::SoundLoop()
|
||||||
|
|
||||||
bool float32_capable = palIsExtensionPresent("AL_EXT_float32") != 0;
|
bool float32_capable = palIsExtensionPresent("AL_EXT_float32") != 0;
|
||||||
bool surround_capable = palIsExtensionPresent("AL_EXT_MCFORMATS") || IsCreativeXFi();
|
bool surround_capable = palIsExtensionPresent("AL_EXT_MCFORMATS") || IsCreativeXFi();
|
||||||
bool use_surround =
|
bool use_surround = SConfig::GetInstance().ShouldUseDPL2Decoder() && surround_capable;
|
||||||
SConfig::GetInstance().bDPL2Decoder && surround_capable && !SConfig::GetInstance().bDSPHLE;
|
|
||||||
|
|
||||||
// As there is no extension to check for 32-bit fixed point support
|
// As there is no extension to check for 32-bit fixed point support
|
||||||
// and we know that only a X-Fi with hardware OpenAL supports it,
|
// and we know that only a X-Fi with hardware OpenAL supports it,
|
||||||
|
|
|
@ -19,7 +19,7 @@ PulseAudio::PulseAudio() = default;
|
||||||
|
|
||||||
bool PulseAudio::Init()
|
bool PulseAudio::Init()
|
||||||
{
|
{
|
||||||
m_stereo = !SConfig::GetInstance().bDPL2Decoder || SConfig::GetInstance().bDSPHLE;
|
m_stereo = !SConfig::GetInstance().ShouldUseDPL2Decoder();
|
||||||
m_channels = m_stereo ? 2 : 6; // will tell PA we use a Stereo or 5.0 channel setup
|
m_channels = m_stereo ? 2 : 6; // will tell PA we use a Stereo or 5.0 channel setup
|
||||||
|
|
||||||
NOTICE_LOG(AUDIO, "PulseAudio backend using %d channels", m_channels);
|
NOTICE_LOG(AUDIO, "PulseAudio backend using %d channels", m_channels);
|
||||||
|
|
|
@ -1063,3 +1063,8 @@ IniFile SConfig::LoadGameIni(const std::string& id, std::optional<u16> revision)
|
||||||
game_ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + filename, true);
|
game_ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + filename, true);
|
||||||
return game_ini;
|
return game_ini;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SConfig::ShouldUseDPL2Decoder() const
|
||||||
|
{
|
||||||
|
return bDPL2Decoder && !bDSPHLE;
|
||||||
|
}
|
||||||
|
|
|
@ -173,6 +173,9 @@ struct SConfig
|
||||||
bool bEnableCustomRTC;
|
bool bEnableCustomRTC;
|
||||||
u32 m_customRTCValue;
|
u32 m_customRTCValue;
|
||||||
|
|
||||||
|
// DPL2
|
||||||
|
bool ShouldUseDPL2Decoder() const;
|
||||||
|
|
||||||
DiscIO::Region m_region;
|
DiscIO::Region m_region;
|
||||||
|
|
||||||
std::string m_strVideoBackend;
|
std::string m_strVideoBackend;
|
||||||
|
|
Loading…
Reference in New Issue