Have the AudioUnit callback drive the internal mixer directly instead

of going through an intermediate thread and buffer. This seems to be
how Core Audio is meant to be used, although I still haven't read the
manual.

Indeed, sound on OS X works perfectly now.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5555 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-05-31 05:05:53 +00:00
parent 99e7a2ceac
commit fdd532356a
2 changed files with 62 additions and 97 deletions

View File

@ -31,10 +31,12 @@
class CoreAudioSound : public SoundStream
{
#if defined(__APPLE__)
Common::Thread *thread;
Common::Event soundSyncEvent;
Common::CriticalSection soundCriticalSection;
Common::Thread *thread;
Common::CriticalSection soundCriticalSection;
Common::Event soundSyncEvent;
ComponentDescription desc;
AudioUnit audioUnit;
public:
CoreAudioSound(CMixer *mixer);
@ -42,19 +44,18 @@ public:
virtual bool Start();
virtual void SoundLoop();
virtual void Stop();
virtual void Stop();
static bool isValid() {
return true;
}
virtual bool usesMixer() const {
return true;
virtual bool usesMixer() const {
return true;
}
virtual void Update();
private:
bool CoreAudioInit();
void RenderSamples(void *target, UInt32 size);
#else
public:
CoreAudioSound(CMixer *mixer) : SoundStream(mixer) {}
@ -62,4 +63,3 @@ public:
};
#endif