diff options
| author | Volker Rümelin <vr_qemu@t-online.de> | 2025-05-15 07:44:29 +0200 |
|---|---|---|
| committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2025-05-25 11:28:28 +0200 |
| commit | 5d978c5da7f7d85d3a74b7d4dbe9ba5c5584d560 (patch) | |
| tree | 472e1b3621572c13e025084ea9344005887d64ce /audio/mixeng.h | |
| parent | 9ddb7c85c965636f7abf91382dc40175ce121aa3 (diff) | |
| download | focaccia-qemu-5d978c5da7f7d85d3a74b7d4dbe9ba5c5584d560.tar.gz focaccia-qemu-5d978c5da7f7d85d3a74b7d4dbe9ba5c5584d560.zip | |
audio: add float sample endianness converters
Commit ed2a4a7941 ("audio: proper support for float samples in
mixeng") added support for float audio samples. As there were no
audio frontend devices with float support at that time, the code
was limited to native endian float samples.
When nobody was paying attention, an audio device that supports
floating point samples crept in with commit eb9ad377bb
("virtio-sound: handle control messages and streams").
Add code for the audio subsystem to convert float samples to the
correct endianness.
The type punning code was taken from the PipeWire project.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20250515054429.7385-7-vr_qemu@t-online.de>
Diffstat (limited to 'audio/mixeng.h')
| -rw-r--r-- | audio/mixeng.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/mixeng.h b/audio/mixeng.h index a5f56d2c26..ead93ac2f7 100644 --- a/audio/mixeng.h +++ b/audio/mixeng.h @@ -42,9 +42,9 @@ typedef void (f_sample) (void *dst, const struct st_sample *src, int samples); extern t_sample *mixeng_conv[2][2][2][3]; extern f_sample *mixeng_clip[2][2][2][3]; -/* indices: [stereo] */ -extern t_sample *mixeng_conv_float[2]; -extern f_sample *mixeng_clip_float[2]; +/* indices: [stereo][swap endianness] */ +extern t_sample *mixeng_conv_float[2][2]; +extern f_sample *mixeng_clip_float[2][2]; void *st_rate_start (int inrate, int outrate); void st_rate_flow(void *opaque, st_sample *ibuf, st_sample *obuf, |