mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Code cleanup, removed extern declaration in sound streams
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4688 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -17,14 +17,11 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "Thread.h"
|
||||
#include "../../../PluginSpecs/pluginspecs_dsp.h"
|
||||
#include "AlsaSoundStream.h"
|
||||
|
||||
#define BUFFER_SIZE 4096
|
||||
#define BUFFER_SIZE_BYTES (BUFFER_SIZE*2*2)
|
||||
|
||||
extern DSPInitialize g_dspInitialize;
|
||||
|
||||
AlsaSound::AlsaSound(CMixer *mixer) : SoundStream(mixer), thread_data(0), handle(NULL)
|
||||
{
|
||||
mix_buffer = new u8[BUFFER_SIZE_BYTES];
|
||||
@ -55,18 +52,6 @@ void AlsaSound::Stop()
|
||||
thread = NULL;
|
||||
}
|
||||
|
||||
void AlsaSound::Clear()
|
||||
{
|
||||
if(!*g_dspInitialize.pEmulatorState)
|
||||
{
|
||||
g_muted = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_muted = true;
|
||||
}
|
||||
}
|
||||
|
||||
void AlsaSound::Update()
|
||||
{
|
||||
// don't need to do anything here.
|
||||
@ -76,12 +61,12 @@ void AlsaSound::Update()
|
||||
void AlsaSound::SoundLoop()
|
||||
{
|
||||
AlsaInit();
|
||||
// nakee: What is the optimal value?
|
||||
int frames_to_deliver = BUFFER_SIZE;
|
||||
while (!thread_data)
|
||||
{
|
||||
// nakee: What is the optimal value?
|
||||
int frames_to_deliver = 4096;
|
||||
m_mixer->Mix(reinterpret_cast<short *>(mix_buffer), frames_to_deliver);
|
||||
int rc = g_muted ? 1337 : snd_pcm_writei(handle, mix_buffer, frames_to_deliver);
|
||||
int rc = m_muted ? 1337 : snd_pcm_writei(handle, mix_buffer, frames_to_deliver);
|
||||
if (rc == -EPIPE)
|
||||
{
|
||||
// Underrun
|
||||
|
Reference in New Issue
Block a user