From 4a137637976360e94dfc304c291b3166b3c03970 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 16 Jan 2009 18:39:36 +0100 Subject: Add support for 24bit samples encoded in the LSB of 32 bit words --- src/pulse/sample.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/pulse/sample.c') diff --git a/src/pulse/sample.c b/src/pulse/sample.c index 8228a9bb..a6c77345 100644 --- a/src/pulse/sample.c +++ b/src/pulse/sample.c @@ -49,7 +49,9 @@ size_t pa_sample_size(const pa_sample_spec *spec) { [PA_SAMPLE_S32LE] = 4, [PA_SAMPLE_S32BE] = 4, [PA_SAMPLE_S24LE] = 3, - [PA_SAMPLE_S24BE] = 3 + [PA_SAMPLE_S24BE] = 3, + [PA_SAMPLE_S24_32LE] = 4, + [PA_SAMPLE_S24_32BE] = 4 }; pa_assert(spec); @@ -129,6 +131,8 @@ const char *pa_sample_format_to_string(pa_sample_format_t f) { [PA_SAMPLE_S32BE] = "s32be", [PA_SAMPLE_S24LE] = "s24le", [PA_SAMPLE_S24BE] = "s24be", + [PA_SAMPLE_S24_32LE] = "s24-32le", + [PA_SAMPLE_S24_32BE] = "s24-32be", }; if (f < 0 || f >= PA_SAMPLE_MAX) @@ -198,7 +202,7 @@ pa_sample_format_t pa_parse_sample_format(const char *format) { return PA_SAMPLE_S32BE; else if (strcasecmp(format, "s32ne") == 0 || strcasecmp(format, "s32") == 0 || strcasecmp(format, "32") == 0) return PA_SAMPLE_S32NE; - else if (strcasecmp(format, "s24re") == 0) + else if (strcasecmp(format, "s32re") == 0) return PA_SAMPLE_S24RE; else if (strcasecmp(format, "s24le") == 0) return PA_SAMPLE_S24LE; @@ -208,6 +212,14 @@ pa_sample_format_t pa_parse_sample_format(const char *format) { return PA_SAMPLE_S24NE; else if (strcasecmp(format, "s24re") == 0) return PA_SAMPLE_S24RE; + else if (strcasecmp(format, "s24-32le") == 0) + return PA_SAMPLE_S24LE; + else if (strcasecmp(format, "s24-32be") == 0) + return PA_SAMPLE_S24BE; + else if (strcasecmp(format, "s24-32ne") == 0 || strcasecmp(format, "s24-32") == 0) + return PA_SAMPLE_S24NE; + else if (strcasecmp(format, "s24-32re") == 0) + return PA_SAMPLE_S24RE; return -1; } -- cgit