|
| 1 | +diff --git a/Core/HLE/__sceAudio.cpp b/Core/HLE/__sceAudio.cpp |
| 2 | +index 3176d26..f05ad9d 100644 |
| 3 | +--- a/Core/HLE/__sceAudio.cpp |
| 4 | ++++ b/Core/HLE/__sceAudio.cpp |
| 5 | +@@ -82,6 +82,11 @@ static bool m_logAudio; |
| 6 | + static int chanQueueMaxSizeFactor; |
| 7 | + static int chanQueueMinSizeFactor; |
| 8 | + |
| 9 | ++// Accessor for libretro |
| 10 | ++int __AudioGetHostAttemptBlockSize() { |
| 11 | ++ return hostAttemptBlockSize; |
| 12 | ++} |
| 13 | ++ |
| 14 | + static void hleAudioUpdate(u64 userdata, int cyclesLate) { |
| 15 | + // Schedule the next cycle first. __AudioUpdate() may consume cycles. |
| 16 | + CoreTiming::ScheduleEvent(audioIntervalCycles - cyclesLate, eventAudioUpdate, 0); |
| 17 | +diff --git a/Core/HLE/__sceAudio.h b/Core/HLE/__sceAudio.h |
| 18 | +index ae9ca35..f26ae0d 100644 |
| 19 | +--- a/Core/HLE/__sceAudio.h |
| 20 | ++++ b/Core/HLE/__sceAudio.h |
| 21 | +@@ -50,6 +50,8 @@ int __AudioMix(short *outstereo, int numSamples, int sampleRate); |
| 22 | + void __AudioGetDebugStats(char *buf, size_t bufSize); |
| 23 | + void __PushExternalAudio(const s32 *audio, int numSamples); // Should not be used in-game, only at the menu! |
| 24 | + |
| 25 | ++int __AudioGetHostAttemptBlockSize(); |
| 26 | ++ |
| 27 | + // Audio Dumping stuff |
| 28 | + void __StartLogAudio(const Path &filename); |
| 29 | + void __StopLogAudio(); |
| 30 | +diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp |
| 31 | +index eacbca2..26f2cf6 100644 |
| 32 | +--- a/libretro/libretro.cpp |
| 33 | ++++ b/libretro/libretro.cpp |
| 34 | +@@ -379,7 +379,7 @@ class LibretroHost : public Host |
| 35 | + void InitSound() override {} |
| 36 | + void UpdateSound() override |
| 37 | + { |
| 38 | +- extern int hostAttemptBlockSize; |
| 39 | ++ int hostAttemptBlockSize = __AudioGetHostAttemptBlockSize(); |
| 40 | + const int blockSizeMax = 512; |
| 41 | + static int16_t audio[blockSizeMax * 2]; |
| 42 | + assert(hostAttemptBlockSize <= blockSizeMax); |
0 commit comments