diff options
author | Max Kellermann <max@duempel.org> | 2009-02-25 18:48:27 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-25 18:48:27 +0100 |
commit | 074d5ae13ef31ea015e73aee1d92ed49d59905a6 (patch) | |
tree | cd1c6599bcdba50a083c7978a762b9e641160c88 /src | |
parent | 8a882209c366efabca625ce788390b88cc5e5ef7 (diff) | |
download | mpd-074d5ae13ef31ea015e73aee1d92ed49d59905a6.tar.gz mpd-074d5ae13ef31ea015e73aee1d92ed49d59905a6.tar.xz mpd-074d5ae13ef31ea015e73aee1d92ed49d59905a6.zip |
ao: removed AoData.device!=NULL checks
The MPD core guarantees that the audio_output object is always in a
consistent state: either open or closed. When open, it will not call
the open() method again, and when closed, it will not call play().
Removed several checks and the NULL initialization.
Diffstat (limited to '')
-rw-r--r-- | src/output/ao_plugin.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/output/ao_plugin.c b/src/output/ao_plugin.c index 2c5d22a60..d7298fc02 100644 --- a/src/output/ao_plugin.c +++ b/src/output/ao_plugin.c @@ -36,7 +36,6 @@ typedef struct _AoData { static AoData *newAoData(void) { AoData *ret = g_malloc(sizeof(AoData)); - ret->device = NULL; ret->options = NULL; return ret; @@ -148,10 +147,7 @@ static void audioOutputAo_closeDevice(void *data) { AoData *ad = (AoData *)data; - if (ad->device) { - ao_close(ad->device); - ad->device = NULL; - } + ao_close(ad->device); } static bool @@ -160,10 +156,6 @@ audioOutputAo_openDevice(void *data, struct audio_format *audio_format) ao_sample_format format; AoData *ad = (AoData *)data; - if (ad->device) { - audioOutputAo_closeDevice(ad); - } - /* support for 24 bit samples in libao is currently dubious, and until we have sorted that out, resample everything to 16 bit */ @@ -207,9 +199,6 @@ audioOutputAo_play(void *data, const void *chunk, size_t size) { AoData *ad = (AoData *)data; - if (ad->device == NULL) - return false; - if (size > ad->writeSize) size = ad->writeSize; |