mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
DSound: use DSound notifications to produce sound.
Pretty straightforward; IDirectSoundNotify lets you register for notifications after a certain amount of sound has played, so use that instead of depending on Update() notifications from the CPU thread. Also, while I'm here, reduce the buffer size by a factor of 4; this seems to reduce the latency, although the difference is sort of subtle.
This commit is contained in:
@ -12,14 +12,14 @@
|
||||
#include <mmsystem.h>
|
||||
#include <dsound.h>
|
||||
|
||||
#define BUFSIZE (1024 * 8 * 4)
|
||||
#define BUFSIZE (256 * 8 * 4)
|
||||
#endif
|
||||
|
||||
class DSound final : public SoundStream
|
||||
{
|
||||
#ifdef _WIN32
|
||||
std::thread thread;
|
||||
Common::Event soundSyncEvent;
|
||||
HANDLE soundSyncEvent;
|
||||
void *hWnd;
|
||||
|
||||
IDirectSound8* ds;
|
||||
@ -65,7 +65,6 @@ public:
|
||||
virtual void Stop();
|
||||
virtual void Clear(bool mute);
|
||||
static bool isValid() { return true; }
|
||||
virtual void Update();
|
||||
|
||||
#else
|
||||
public:
|
||||
|
Reference in New Issue
Block a user