Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/AudioSdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ class AudioSdl : public AudioDevice
size_t m_currentBufferFramePos;
size_t m_currentBufferFramesCount;

bool m_stopped;

SDL_AudioDeviceID m_outputDevice;

SDL_AudioSpec m_inputAudioHandle;
Expand Down
6 changes: 0 additions & 6 deletions src/core/AudioEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,9 @@ void AudioEngine::clearInternal()

void AudioEngine::changeQuality(const struct qualitySettings & qs)
{
// don't delete the audio-device
stopProcessing();

m_qualitySettings = qs;

emit sampleRateChanged();
emit qualitySettingsChanged();

startProcessing();
}


Expand Down
3 changes: 0 additions & 3 deletions src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,6 @@ void Song::processNextBuffer()
return;
}

// If we have no tracks to play, there is nothing to do
if (trackList.empty()) { return; }

// If the playback position is outside of the range [begin, end), move it to
// begin and inform interested parties.
// Returns true if the playback position was moved, else false.
Expand Down
22 changes: 2 additions & 20 deletions src/core/audio/AudioSdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ AudioSdl::~AudioSdl()

void AudioSdl::startProcessing()
{
m_stopped = false;

SDL_PauseAudioDevice (m_outputDevice, 0);
SDL_PauseAudioDevice (m_inputDevice, 0);
}
Expand All @@ -150,19 +148,8 @@ void AudioSdl::startProcessing()

void AudioSdl::stopProcessing()
{
if( SDL_GetAudioDeviceStatus(m_outputDevice) == SDL_AUDIO_PLAYING )
{
SDL_LockAudioDevice (m_inputDevice);
SDL_LockAudioDevice (m_outputDevice);

m_stopped = true;

SDL_PauseAudioDevice (m_inputDevice, 1);
SDL_PauseAudioDevice (m_outputDevice, 1);

SDL_UnlockAudioDevice (m_inputDevice);
SDL_UnlockAudioDevice (m_outputDevice);
}
SDL_PauseAudioDevice (m_inputDevice, 1);
SDL_PauseAudioDevice (m_outputDevice, 1);
}

void AudioSdl::sdlAudioCallback( void * _udata, Uint8 * _buf, int _len )
Expand All @@ -177,11 +164,6 @@ void AudioSdl::sdlAudioCallback( void * _udata, Uint8 * _buf, int _len )

void AudioSdl::sdlAudioCallback( Uint8 * _buf, int _len )
{
if( m_stopped )
{
memset( _buf, 0, _len );
return;
}

// SDL2: process float samples
while( _len )
Expand Down