diff --git a/aegisub/src/audio_player_portaudio.cpp b/aegisub/src/audio_player_portaudio.cpp index ed4cb6de5..4ce66e736 100644 --- a/aegisub/src/audio_player_portaudio.cpp +++ b/aegisub/src/audio_player_portaudio.cpp @@ -50,26 +50,18 @@ // Uncomment to enable extremely spammy debug logging //#define PORTAUDIO_DEBUG -// Init reference counter -int PortAudioPlayer::pa_refcount = 0; - PortAudioPlayer::PortAudioPlayer() { - // Initialize portaudio - if (!pa_refcount) { - PaError err = Pa_Initialize(); + PaError err = Pa_Initialize(); - if (err != paNoError) - throw PortAudioError(std::string("Failed opening PortAudio:") + Pa_GetErrorText(err)); - } - pa_refcount++; + if (err != paNoError) + throw PortAudioError(std::string("Failed opening PortAudio:") + Pa_GetErrorText(err)); volume = 1.0f; pa_start = 0.0; } PortAudioPlayer::~PortAudioPlayer() { - // Deinit portaudio - if (!--pa_refcount) Pa_Terminate(); + Pa_Terminate(); } void PortAudioPlayer::OpenStream() { diff --git a/aegisub/src/audio_player_portaudio.h b/aegisub/src/audio_player_portaudio.h index 4a63fc30c..7bac865ec 100644 --- a/aegisub/src/audio_player_portaudio.h +++ b/aegisub/src/audio_player_portaudio.h @@ -51,9 +51,6 @@ DEFINE_SIMPLE_EXCEPTION_NOINNER(PortAudioError, agi::Exception, "audio/player/po /// @brief PortAudio Player /// class PortAudioPlayer : public AudioPlayer { - /// PortAudio initilisation reference counter - static int pa_refcount; - float volume; ///< Current volume level int64_t current; ///< Current position int64_t start; ///< Start position