Merge branch 'master' into feature/savestates-2

This commit is contained in:
Hamish Milne 2020-04-12 11:24:06 +01:00
commit 828f88d20a
76 changed files with 3507 additions and 1369 deletions

View file

@ -38,14 +38,14 @@ void DspInterface::EnableStretching(bool enable) {
perform_time_stretching = enable;
}
void DspInterface::OutputFrame(StereoFrame16& frame) {
void DspInterface::OutputFrame(StereoFrame16 frame) {
if (!sink)
return;
fifo.Push(frame.data(), frame.size());
if (Core::System::GetInstance().VideoDumper().IsDumping()) {
Core::System::GetInstance().VideoDumper().AddAudioFrame(frame);
Core::System::GetInstance().VideoDumper().AddAudioFrame(std::move(frame));
}
}
@ -56,7 +56,7 @@ void DspInterface::OutputSample(std::array<s16, 2> sample) {
fifo.Push(&sample, 1);
if (Core::System::GetInstance().VideoDumper().IsDumping()) {
Core::System::GetInstance().VideoDumper().AddAudioSample(sample);
Core::System::GetInstance().VideoDumper().AddAudioSample(std::move(sample));
}
}

View file

@ -101,7 +101,7 @@ public:
void EnableStretching(bool enable);
protected:
void OutputFrame(StereoFrame16& frame);
void OutputFrame(StereoFrame16 frame);
void OutputSample(std::array<s16, 2> sample);
private:

View file

@ -431,7 +431,7 @@ bool DspHle::Impl::Tick() {
// shared memory region)
current_frame = GenerateCurrentFrame();
parent.OutputFrame(current_frame);
parent.OutputFrame(std::move(current_frame));
return true;
}

View file

@ -289,7 +289,9 @@ void Source::GenerateFrame() {
break;
}
}
state.next_sample_number += static_cast<u32>(frame_position);
// TODO(jroweboy): Keep track of frame_position independently so that it doesn't lose precision
// over time
state.next_sample_number += static_cast<u32>(frame_position * state.rate_multiplier);
state.filters.ProcessFrame(current_frame);
}

View file

@ -483,7 +483,8 @@ DspLle::DspLle(Memory::MemorySystem& memory, bool multithread)
*memory.GetFCRAMPointer(address - Memory::FCRAM_PADDR) = value;
};
impl->teakra.SetAHBMCallback(ahbm);
impl->teakra.SetAudioCallback([this](std::array<s16, 2> sample) { OutputSample(sample); });
impl->teakra.SetAudioCallback(
[this](std::array<s16, 2> sample) { OutputSample(std::move(sample)); });
}
DspLle::~DspLle() = default;