From f938b959259c145f58edc64f90646adf6e18199a Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 7 Oct 2013 20:25:35 +0200 Subject: [PATCH] Revert "Merge pull request #4068 from bollu/AudioArtefactFix" This reverts commit e4c6ba9b01e2ca2d6faf7465ae579d4313408776, reversing changes made to 061efd35dbd61f3a083bf315a57ab4a9d8f0e5be. --- Core/HLE/__sceAudio.cpp | 2 +- Core/HLE/__sceAudio.h | 3 --- Core/PSPMixer.cpp | 2 +- Core/PSPMixer.h | 4 ---- UI/NativeApp.cpp | 16 +++------------- 5 files changed, 5 insertions(+), 22 deletions(-) diff --git a/Core/HLE/__sceAudio.cpp b/Core/HLE/__sceAudio.cpp index cc960b39c7..e847f8ff03 100644 --- a/Core/HLE/__sceAudio.cpp +++ b/Core/HLE/__sceAudio.cpp @@ -381,7 +381,7 @@ int __AudioMix(short *outstereo, int numFrames) { if(!__gainAudioQueueLock()){ - return SCE_AUDIO_NO_MIX; + return numFrames; } diff --git a/Core/HLE/__sceAudio.h b/Core/HLE/__sceAudio.h index 4492703ad7..e338557683 100644 --- a/Core/HLE/__sceAudio.h +++ b/Core/HLE/__sceAudio.h @@ -17,9 +17,6 @@ #pragma once #include "sceAudio.h" -#ifndef SCE_AUDIO_NO_MIX -#define SCE_AUDIO_NO_MIX -1 -#endif // Easy interface for sceAudio to write to, to keep the complexity in check. diff --git a/Core/PSPMixer.cpp b/Core/PSPMixer.cpp index 7dc836faea..69cec9f4c9 100644 --- a/Core/PSPMixer.cpp +++ b/Core/PSPMixer.cpp @@ -28,7 +28,7 @@ int PSPMixer::Mix(short *stereoout, int numSamples) { int numFrames = __AudioMix(stereoout, numSamples); #ifdef _WIN32 - if (numFrames < numSamples && numFrames != SCE_AUDIO_NO_MIX) { + if (numFrames < numSamples) { // Our dsound backend will not stop playing, let's just feed it zeroes if we miss data. memset(stereoout + 2 * 2 * numFrames, 0, 2 * 2 * (numSamples - numFrames)); numFrames = numSamples; diff --git a/Core/PSPMixer.h b/Core/PSPMixer.h index ef64a21c83..240d073552 100644 --- a/Core/PSPMixer.h +++ b/Core/PSPMixer.h @@ -20,10 +20,6 @@ #include "MemMap.h" #include "Host.h" -#ifndef SCE_AUDIO_NO_MIX -#define SCE_AUDIO_NO_MIX -1 -#endif - class PSPMixer : public PMixer { public: diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 6843fd1a7e..40a29057f2 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -194,23 +194,13 @@ void NativeHost::ShutdownSound() { int NativeMix(short *audio, int num_samples) { // ILOG("Entering mixer"); - int numMixedSamples = 0; - if (g_mixer) { - numMixedSamples = g_mixer->Mix(audio, num_samples); - - if(numMixedSamples == SCE_AUDIO_NO_MIX) { - goto noMix; - } - - } else{ - //this is the one place a goto is warranted. Still, find a way to rewrite - //;_; - noMix: + num_samples = g_mixer->Mix(audio, num_samples); + } else { memset(audio, 0, num_samples * 2 * sizeof(short)); } // ILOG("Leaving mixer"); - return numMixedSamples; + return num_samples; } void NativeGetAppInfo(std::string *app_dir_name, std::string *app_nice_name, bool *landscape) {