mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Disable framerate correction for OpenAL
OpenAL itself stretch the time on slowdowns, so the Mixer isn't allowed also to change the rate.
This commit is contained in:
@ -20,7 +20,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Executed from sound stream thread
|
// Executed from sound stream thread
|
||||||
unsigned int CMixer::Mix(short* samples, unsigned int numSamples)
|
unsigned int CMixer::Mix(short* samples, unsigned int numSamples, bool consider_framelimit)
|
||||||
{
|
{
|
||||||
if (!samples)
|
if (!samples)
|
||||||
return 0;
|
return 0;
|
||||||
@ -58,7 +58,7 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples)
|
|||||||
|
|
||||||
u32 framelimit = SConfig::GetInstance().m_Framelimit;
|
u32 framelimit = SConfig::GetInstance().m_Framelimit;
|
||||||
float aid_sample_rate = AudioInterface::GetAIDSampleRate() + offset;
|
float aid_sample_rate = AudioInterface::GetAIDSampleRate() + offset;
|
||||||
if (framelimit > 2)
|
if (consider_framelimit && framelimit > 2)
|
||||||
{
|
{
|
||||||
aid_sample_rate = aid_sample_rate * (framelimit - 1) * 5 / VideoInterface::TargetRefreshRate;
|
aid_sample_rate = aid_sample_rate * (framelimit - 1) * 5 / VideoInterface::TargetRefreshRate;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
virtual ~CMixer() {}
|
virtual ~CMixer() {}
|
||||||
|
|
||||||
// Called from audio threads
|
// Called from audio threads
|
||||||
virtual unsigned int Mix(short* samples, unsigned int numSamples);
|
virtual unsigned int Mix(short* samples, unsigned int numSamples, bool consider_framelimit = true);
|
||||||
virtual void Premix(short * /*samples*/, unsigned int /*numSamples*/) {}
|
virtual void Premix(short * /*samples*/, unsigned int /*numSamples*/) {}
|
||||||
|
|
||||||
// Called from main thread
|
// Called from main thread
|
||||||
|
@ -192,7 +192,7 @@ void OpenALStream::SoundLoop()
|
|||||||
unsigned int minSamples = surround_capable ? 240 : 0; // DPL2 accepts 240 samples minimum (FWRDURATION)
|
unsigned int minSamples = surround_capable ? 240 : 0; // DPL2 accepts 240 samples minimum (FWRDURATION)
|
||||||
|
|
||||||
numSamples = (numSamples > OAL_MAX_SAMPLES) ? OAL_MAX_SAMPLES : numSamples;
|
numSamples = (numSamples > OAL_MAX_SAMPLES) ? OAL_MAX_SAMPLES : numSamples;
|
||||||
numSamples = m_mixer->Mix(realtimeBuffer, numSamples);
|
numSamples = m_mixer->Mix(realtimeBuffer, numSamples, false);
|
||||||
|
|
||||||
// Convert the samples from short to float
|
// Convert the samples from short to float
|
||||||
float dest[OAL_MAX_SAMPLES * STEREO_CHANNELS];
|
float dest[OAL_MAX_SAMPLES * STEREO_CHANNELS];
|
||||||
|
Reference in New Issue
Block a user