aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio_format.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-04 20:41:05 +0200
committerMax Kellermann <max@duempel.org>2011-10-04 20:41:32 +0200
commitf77cd63286bedbd995bed0e232498543e28d3957 (patch)
tree99e7954f2d00849507551d705f2be2c8aa58f723 /src/audio_format.h
parent2378c2d75427e13738ac888a84059ca72bd004e1 (diff)
downloadmpd-f77cd63286bedbd995bed0e232498543e28d3957.tar.gz
mpd-f77cd63286bedbd995bed0e232498543e28d3957.tar.xz
mpd-f77cd63286bedbd995bed0e232498543e28d3957.zip
audio_format: add constant MAX_CHANNELS
To be used in fixed-size arrays.
Diffstat (limited to '')
-rw-r--r--src/audio_format.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/audio_format.h b/src/audio_format.h
index 1a54a092a..6e4f94b71 100644
--- a/src/audio_format.h
+++ b/src/audio_format.h
@@ -44,6 +44,8 @@ enum sample_format {
SAMPLE_FORMAT_S32,
};
+static const unsigned MAX_CHANNELS = 8;
+
/**
* This structure describes the format of a raw PCM stream.
*/
@@ -180,7 +182,7 @@ audio_valid_sample_format(enum sample_format format)
static inline bool
audio_valid_channel_count(unsigned channels)
{
- return channels >= 1 && channels <= 8;
+ return channels >= 1 && channels <= MAX_CHANNELS;
}
/**