Add support for 24bit samples encoded in the LSB of 32 bit words

This commit is contained in:
Lennart Poettering 2009-01-16 18:39:36 +01:00
parent 6dc76d1158
commit 4a13763797
13 changed files with 339 additions and 19 deletions

View file

@ -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;
}