mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-03 01:35:27 +02:00
Merge pull request #15009 from unknownbrackets/audio-cleanup
Audio: Correct protection against time skew
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -283,7 +283,7 @@ void StereoResampler::PushSamples(const s32 *samples, unsigned int numSamples) {
|
||||
}
|
||||
|
||||
// Check if we need to roll over to the start of the buffer during the copy.
|
||||
int indexW_left_samples = m_maxBufsize * 2 - (indexW & INDEX_MASK);
|
||||
unsigned int indexW_left_samples = m_maxBufsize * 2 - (indexW & INDEX_MASK);
|
||||
if (numSamples * 2 > indexW_left_samples) {
|
||||
ClampBufferToS16WithVolume(&m_buffer[indexW & INDEX_MASK], samples, indexW_left_samples);
|
||||
ClampBufferToS16WithVolume(&m_buffer[0], samples + indexW_left_samples, numSamples * 2 - indexW_left_samples);
|
||||
|
||||
@@ -345,7 +345,7 @@ int BackgroundAudio::Play() {
|
||||
|
||||
double now = time_now_d();
|
||||
int sz = 44100 / 60;
|
||||
if (lastPlaybackTime_ > 0.0 && lastPlaybackTime_ >= now) {
|
||||
if (lastPlaybackTime_ > 0.0 && lastPlaybackTime_ <= now) {
|
||||
sz = (int)((now - lastPlaybackTime_) * 44100);
|
||||
}
|
||||
sz = std::min(BUFSIZE / 2, sz);
|
||||
|
||||
Reference in new issue
Block a user