aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/audio.c2
-rw-r--r--src/audio_format.h12
2 files changed, 13 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) {
diff --git a/src/audio_format.h b/src/audio_format.h
index 1cfb258ae..d2461a338 100644
--- a/src/audio_format.h
+++ b/src/audio_format.h
@@ -27,6 +27,18 @@ struct audio_format {
mpd_sint8 channels;
};
+static inline void audio_format_clear(struct audio_format *af)
+{
+ af->sampleRate = 0;
+ af->bits = 0;
+ af->channels = 0;
+}
+
+static inline int audio_format_defined(const struct audio_format *af)
+{
+ return af->sampleRate != 0;
+}
+
static inline int audio_format_equals(const struct audio_format *a,
const struct audio_format *b)
{