mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-28 16:20:52 +00:00
A little fix for the Throttle, it wasn't getting the correct sample_rate thus was too fast
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2774 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
881678540d
commit
632e3bfc85
@ -62,7 +62,7 @@ void CMixer::Mix(short *samples, int numSamples)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CMixer::PushSamples(short *samples, int num_stereo_samples)
|
void CMixer::PushSamples(short *samples, int num_stereo_samples, int core_sample_rate)
|
||||||
{
|
{
|
||||||
if (!soundStream)
|
if (!soundStream)
|
||||||
return;
|
return;
|
||||||
@ -85,7 +85,7 @@ void CMixer::PushSamples(short *samples, int num_stereo_samples)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Write Other Audio
|
// Write Other Audio
|
||||||
if (! m_throttle)
|
if (!m_throttle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ void CMixer::PushSamples(short *samples, int num_stereo_samples)
|
|||||||
|
|
||||||
push_sync.Enter();
|
push_sync.Enter();
|
||||||
while (num_stereo_samples) {
|
while (num_stereo_samples) {
|
||||||
acc += m_sampleRate;
|
acc += core_sample_rate;
|
||||||
while (num_stereo_samples && (acc >= 48000)) {
|
while (num_stereo_samples && (acc >= 48000)) {
|
||||||
PV4l=PV3l;
|
PV4l=PV3l;
|
||||||
PV3l=PV2l;
|
PV3l=PV2l;
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
void Mix(short *sample, int numSamples);
|
void Mix(short *sample, int numSamples);
|
||||||
|
|
||||||
// Called from main thread
|
// Called from main thread
|
||||||
void PushSamples(short* samples, int num_stereo_samples);
|
void PushSamples(short* samples, int num_stereo_samples, int core_sample_rate);
|
||||||
|
|
||||||
virtual void Premix(short *samples, int numSamples) {}
|
virtual void Premix(short *samples, int numSamples) {}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "HLEMixer.h"
|
#include "HLEMixer.h"
|
||||||
|
|
||||||
void HLEMixer::MixUCode(short *samples, int numSamples) {
|
void HLEMixer::MixUCode(short *samples, int numSamples) {
|
||||||
//if this was called directly from the HLE, and not by timeout
|
// if this was called directly from the HLE, and not by timeout
|
||||||
if (g_Config.m_EnableHLEAudio && IsHLEReady()) {
|
if (g_Config.m_EnableHLEAudio && IsHLEReady()) {
|
||||||
IUCode* pUCode = CDSPHandler::GetInstance().GetUCode();
|
IUCode* pUCode = CDSPHandler::GetInstance().GetUCode();
|
||||||
if (pUCode != NULL)
|
if (pUCode != NULL)
|
||||||
|
@ -346,7 +346,10 @@ void DSP_SendAIBuffer(unsigned int address, int sample_rate)
|
|||||||
//if (log_ai)
|
//if (log_ai)
|
||||||
// g_wave_writer.AddStereoSamples(samples, 8);
|
// g_wave_writer.AddStereoSamples(samples, 8);
|
||||||
}
|
}
|
||||||
pMixer->PushSamples(samples, 32 / 4);
|
|
||||||
|
// sample_rate is usually 32k here,
|
||||||
|
// see Core/DSP/DSP.cpp for better information
|
||||||
|
pMixer->PushSamples(samples, 32 / 4, sample_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SoundStream is updated only when necessary (there is no 70 ms limit
|
// SoundStream is updated only when necessary (there is no 70 ms limit
|
||||||
|
@ -371,7 +371,7 @@ void DSP_SendAIBuffer(unsigned int address, int sample_rate)
|
|||||||
//if (log_ai)
|
//if (log_ai)
|
||||||
// g_wave_writer.AddStereoSamples(samples, 8);
|
// g_wave_writer.AddStereoSamples(samples, 8);
|
||||||
}
|
}
|
||||||
soundStream->GetMixer()->PushSamples(samples, 32 / 4);
|
soundStream->GetMixer()->PushSamples(samples, 32 / 4, sample_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SoundStream is updated only when necessary (there is no 70 ms limit
|
// SoundStream is updated only when necessary (there is no 70 ms limit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user