Skip to content

Commit

Permalink
Fixed audio stop function + patched 417a8e7 (#1893)
Browse files Browse the repository at this point in the history
Co-authored-by: Semphris <semphris@protonmail.com>
  • Loading branch information
Semphriss and Semphris authored Nov 16, 2021
1 parent 91c7f0e commit d46291d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/audio/openal_sound_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ OpenALSoundSource::~OpenALSoundSource()
void
OpenALSoundSource::stop()
{
#ifndef __EMSCRIPTEN__
// FIXME: Emscripten's OpenAL port crashes when calling this, see:
// https://github.com/emscripten-core/emscripten/issues/13797
// The sounds stop anyways, but the code is probably unclean as a result.
#ifdef WIN32
// See commit 417a8e7a8c599bfc2dceaec7b6f64ac865318ef1
alSourceRewindv(1, &m_source); // Stops the source
#else
set_volume(0.f);
alSourceStop(m_source);
#endif
alSourcei(m_source, AL_BUFFER, AL_NONE);
try
Expand Down

0 comments on commit d46291d

Please sign in to comment.