From d92d1639e1000eb5041f6e87a744a4536b46cbab Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 23 Aug 2008 16:45:06 -0700 Subject: outputBuffer_audio: eliminate the hacky audio_opened variable It's redundant, we already track that stuff elsewhere. --- src/outputBuffer_audio.h | 13 +++---------- 1 file 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__); */ } -- cgit v1.2.3