diff options
author | Max Kellermann <max@duempel.org> | 2008-09-10 11:43:27 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-10 11:43:27 +0200 |
commit | d92543698c8d5ffa0c1adec4da343e5d7ab65d02 (patch) | |
tree | 8de7bd2ba7238fdde837d48e48eef930579b954a /src/audio.c | |
parent | 9ceadb0561d416b3f729fe3471aa7c4ec3ad1456 (diff) | |
download | mpd-d92543698c8d5ffa0c1adec4da343e5d7ab65d02.tar.gz mpd-d92543698c8d5ffa0c1adec4da343e5d7ab65d02.tar.xz mpd-d92543698c8d5ffa0c1adec4da343e5d7ab65d02.zip |
audio_format: added audio_format_clear() and audio_format_defined()
audio_format_clear() sets an audio_format struct to an cleared
(undefined) state, which is both faster and smaller than memset(0).
audio_format_defined() checks if the audio_format struct actually has
a defined value (i.e. non-zero). Both can be used to avoid pointers
to audio_format, replacing the "NULL" value with an "undefined"
audio_format.
Diffstat (limited to '')
-rw-r--r-- | src/audio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/audio.c b/src/audio.c index 839052dc2..dead45991 100644 --- a/src/audio.c +++ b/src/audio.c @@ -231,7 +231,7 @@ static void syncAudioDeviceStates(void) struct audio_output *audioOutput; unsigned int i; - if (!audio_format.channels) + if (!audio_format_defined(&audio_format)) return; for (i = 0; i < audioOutputArraySize; ++i) { |