aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-08-23 16:45:06 -0700
committerEric Wong <normalperson@yhbt.net>2008-08-23 17:14:20 -0700
commitd92d1639e1000eb5041f6e87a744a4536b46cbab (patch)
treec1e03795e21791eef8850bd3fd6c8a640227cf9f
parent087998b644a08504a2f7d843a8d16bc9d91ecbc0 (diff)
downloadmpd-d92d1639e1000eb5041f6e87a744a4536b46cbab.tar.gz
mpd-d92d1639e1000eb5041f6e87a744a4536b46cbab.tar.xz
mpd-d92d1639e1000eb5041f6e87a744a4536b46cbab.zip
outputBuffer_audio: eliminate the hacky audio_opened variable
It's redundant, we already track that stuff elsewhere.
Diffstat (limited to '')
-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__); */
}