mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 18:48:56 -06:00
AudioInterface: Use IsPlaying method
This commit is contained in:
@ -295,8 +295,9 @@ void GenerateAISInterrupt()
|
|||||||
|
|
||||||
static void IncreaseSampleCount(const u32 amount)
|
static void IncreaseSampleCount(const u32 amount)
|
||||||
{
|
{
|
||||||
if (s_control.PSTAT)
|
if (!IsPlaying())
|
||||||
{
|
return;
|
||||||
|
|
||||||
const u32 old_sample_counter = s_sample_counter + 1;
|
const u32 old_sample_counter = s_sample_counter + 1;
|
||||||
s_sample_counter += amount;
|
s_sample_counter += amount;
|
||||||
|
|
||||||
@ -308,7 +309,6 @@ static void IncreaseSampleCount(const u32 amount)
|
|||||||
GenerateAudioInterrupt();
|
GenerateAudioInterrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool IsPlaying()
|
bool IsPlaying()
|
||||||
{
|
{
|
||||||
@ -337,8 +337,9 @@ u32 Get48KHzSampleRateDivisor()
|
|||||||
|
|
||||||
static void Update(u64 userdata, s64 cycles_late)
|
static void Update(u64 userdata, s64 cycles_late)
|
||||||
{
|
{
|
||||||
if (s_control.PSTAT)
|
if (!IsPlaying())
|
||||||
{
|
return;
|
||||||
|
|
||||||
const u64 diff = CoreTiming::GetTicks() - s_last_cpu_time;
|
const u64 diff = CoreTiming::GetTicks() - s_last_cpu_time;
|
||||||
if (diff > s_cpu_cycles_per_sample)
|
if (diff > s_cpu_cycles_per_sample)
|
||||||
{
|
{
|
||||||
@ -348,7 +349,6 @@ static void Update(u64 userdata, s64 cycles_late)
|
|||||||
}
|
}
|
||||||
CoreTiming::ScheduleEvent(GetAIPeriod() - cycles_late, event_type_ai);
|
CoreTiming::ScheduleEvent(GetAIPeriod() - cycles_late, event_type_ai);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int GetAIPeriod()
|
int GetAIPeriod()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user