aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio_format.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-01-15 09:23:36 +0100
committerMax Kellermann <max@duempel.org>2010-01-16 23:44:54 +0100
commit1abfcc56af7de73c2088d7971f744778b5842ed8 (patch)
treecee3e0021348270f86402b9cb7b016e4b820827d /src/audio_format.h
parentda47afe7d1aa6b59bf04764d0bd7d0b91dfac94b (diff)
downloadmpd-1abfcc56af7de73c2088d7971f744778b5842ed8.tar.gz
mpd-1abfcc56af7de73c2088d7971f744778b5842ed8.tar.xz
mpd-1abfcc56af7de73c2088d7971f744778b5842ed8.zip
audio_format: support packed 24 bit samples
Diffstat (limited to 'src/audio_format.h')
-rw-r--r--src/audio_format.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/audio_format.h b/src/audio_format.h
index 7cd606b65..dd32731c3 100644
--- a/src/audio_format.h
+++ b/src/audio_format.h
@@ -30,6 +30,11 @@ enum sample_format {
SAMPLE_FORMAT_S16,
/**
+ * Signed 24 bit integer samples, without padding.
+ */
+ SAMPLE_FORMAT_S24,
+
+ /**
* Signed 24 bit integer samples, packed in 32 bit integers
* (the most significant byte is filled with the sign bit).
*/
@@ -156,6 +161,7 @@ audio_valid_sample_format(enum sample_format format)
switch (format) {
case SAMPLE_FORMAT_S8:
case SAMPLE_FORMAT_S16:
+ case SAMPLE_FORMAT_S24:
case SAMPLE_FORMAT_S24_P32:
case SAMPLE_FORMAT_S32:
return true;
@@ -235,6 +241,9 @@ static inline unsigned audio_format_sample_size(const struct audio_format *af)
case SAMPLE_FORMAT_S16:
return 2;
+ case SAMPLE_FORMAT_S24:
+ return 3;
+
case SAMPLE_FORMAT_S24_P32:
case SAMPLE_FORMAT_S32:
return 4;