From a9d1afbefd489957d7e3250c239f768ca6b7711f Mon Sep 17 00:00:00 2001 From: Greg V Date: Thu, 2 Apr 2020 19:15:29 +0300 Subject: [PATCH] oss: support 24-bit sample formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This works perfectly fine and is required for bitperfect mode on some soundcards, according to Romain Tartière ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198567#c6 Part-of: --- src/modules/oss/oss-util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/oss/oss-util.c b/src/modules/oss/oss-util.c index 42ee7f56a..4deef9f16 100644 --- a/src/modules/oss/oss-util.c +++ b/src/modules/oss/oss-util.c @@ -164,8 +164,13 @@ int pa_oss_auto_format(int fd, pa_sample_spec *ss) { [PA_SAMPLE_FLOAT32BE] = AFMT_QUERY, /* not supported */ [PA_SAMPLE_S32LE] = AFMT_QUERY, /* not supported */ [PA_SAMPLE_S32BE] = AFMT_QUERY, /* not supported */ +#if defined(AFMT_S24_LE) && defined(AFMT_S24_BE) + [PA_SAMPLE_S24LE] = AFMT_S24_LE, + [PA_SAMPLE_S24BE] = AFMT_S24_BE, +#else [PA_SAMPLE_S24LE] = AFMT_QUERY, /* not supported */ [PA_SAMPLE_S24BE] = AFMT_QUERY, /* not supported */ +#endif [PA_SAMPLE_S24_32LE] = AFMT_QUERY, /* not supported */ [PA_SAMPLE_S24_32BE] = AFMT_QUERY, /* not supported */ };