aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer_audio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/outputBuffer_audio.h')
-rw-r--r--src/outputBuffer_audio.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/outputBuffer_audio.h b/src/outputBuffer_audio.h
index 2af40c95f..fb366f7d7 100644
--- a/src/outputBuffer_audio.h
+++ b/src/outputBuffer_audio.h
@@ -1,7 +1,3 @@
-/* This is where audio devices are managed inside the output buffer thread */
-
-static int audio_opened;
-
/*
* reopen is set when we get a new song and there's a difference
* in audio format
@@ -10,13 +6,11 @@ static int open_audio_devices(int reopen)
{
assert(pthread_equal(pthread_self(), ob.thread));
- if (!reopen && audio_opened)
+ if (!reopen && isAudioDeviceOpen())
return 0;
- if (openAudioDevice(&ob.audio_format) >= 0) {
- audio_opened = 1;
+
+ if (openAudioDevice(&ob.audio_format) >= 0)
return 0;
- }
- audio_opened = 0;
stop_playback();
player_seterror(PLAYER_ERROR_AUDIO, NULL);
ERROR("problems opening audio device\n");
@@ -29,7 +23,6 @@ static void close_audio_devices(void)
DEBUG(__FILE__":%s %d\n", __func__, __LINE__);
dropBufferedAudio();
closeAudioDevice();
- audio_opened = 0;
/* DEBUG(__FILE__":%s %d\n", __func__, __LINE__); */
}