Add PulseAudio signed 24bit packed formats

This commit is contained in:
0joshuaolson1 2016-07-30 14:45:28 -06:00
parent 9defcda7f4
commit 662286a312

View file

@ -101,13 +101,13 @@ static enum SoundIoFormat from_pulseaudio_format(pa_sample_spec sample_spec) {
case PA_SAMPLE_S32BE: return SoundIoFormatS32BE;
case PA_SAMPLE_S24_32LE: return SoundIoFormatS24LE;
case PA_SAMPLE_S24_32BE: return SoundIoFormatS24BE;
case PA_SAMPLE_S24LE: return SoundIoFormatS24PackedLE;
case PA_SAMPLE_S24BE: return SoundIoFormatS24PackedBE;
case PA_SAMPLE_MAX:
case PA_SAMPLE_INVALID:
case PA_SAMPLE_ALAW:
case PA_SAMPLE_ULAW:
case PA_SAMPLE_S24LE:
case PA_SAMPLE_S24BE:
return SoundIoFormatInvalid;
}
return SoundIoFormatInvalid;
@ -183,7 +183,7 @@ static int set_all_device_channel_layouts(struct SoundIoDevice *device) {
}
static int set_all_device_formats(struct SoundIoDevice *device) {
device->format_count = 9;
device->format_count = 11;
device->formats = ALLOCATE(enum SoundIoFormat, device->format_count);
if (!device->formats)
return SoundIoErrorNoMem;
@ -196,6 +196,8 @@ static int set_all_device_formats(struct SoundIoDevice *device) {
device->formats[6] = SoundIoFormatS32BE;
device->formats[7] = SoundIoFormatS24LE;
device->formats[8] = SoundIoFormatS24BE;
device->formats[9] = SoundIoFormatS24PackedLE;
device->formats[10] = SoundIoFormatS24PackedBE;
return 0;
}
@ -518,6 +520,8 @@ static pa_sample_format_t to_pulseaudio_format(enum SoundIoFormat format) {
case SoundIoFormatS16BE: return PA_SAMPLE_S16BE;
case SoundIoFormatS24LE: return PA_SAMPLE_S24_32LE;
case SoundIoFormatS24BE: return PA_SAMPLE_S24_32BE;
case SoundIoFormatS24PackedLE: return PA_SAMPLE_S24LE;
case SoundIoFormatS24PackedBE: return PA_SAMPLE_S24BE;
case SoundIoFormatS32LE: return PA_SAMPLE_S32LE;
case SoundIoFormatS32BE: return PA_SAMPLE_S32BE;
case SoundIoFormatFloat32LE: return PA_SAMPLE_FLOAT32LE;
@ -529,6 +533,8 @@ static pa_sample_format_t to_pulseaudio_format(enum SoundIoFormat format) {
case SoundIoFormatU16BE:
case SoundIoFormatU24LE:
case SoundIoFormatU24BE:
case SoundIoFormatU24PackedLE:
case SoundIoFormatU24PackedBE:
case SoundIoFormatU32LE:
case SoundIoFormatU32BE:
case SoundIoFormatFloat64LE: