summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2026-03-17 19:02:27 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2026-03-30 14:02:32 +0400
commit924b0be88d5488d1e7b918e005e72cfaaaef87b6 (patch)
treef180996c3618c091bb38cfc7abce8bdffcd9a710 /audio
parent91f6a9cb1b0f11afa74ef7fb20d5579d9dfbe020 (diff)
downloadqemu-924b0be88d5488d1e7b918e005e72cfaaaef87b6.tar.gz
qemu-924b0be88d5488d1e7b918e005e72cfaaaef87b6.zip
audio/mixeng: fix sw/hw mixup in audio_pcm_sw_init_
Commit 42061a14358 ("audio/mixeng: replace redundant pcm_info fields with AudioFormat") accidentally changed the conv/clip function selection in audio_pcm_sw_init_ to use hw->info.af (the hardware voice format) instead of sw->info.af (the software voice format). This causes audio distortion when the software and hardware voices use different formats, as the wrong conversion functions are applied to the audio data. Fix by using sw->info.af, restoring the original behavior. Fixes: 42061a14358c ("audio/mixeng: replace redundant pcm_info fields with AudioFormat") Reported-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_template.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/audio_template.h b/audio/audio_template.h
index fe769cde66..398a727373 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -172,7 +172,7 @@ static int glue (audio_pcm_sw_init_, TYPE) (
sw->empty = true;
#endif
- if (audio_format_is_float(hw->info.af)) {
+ if (audio_format_is_float(sw->info.af)) {
#ifdef DAC
sw->conv = mixeng_conv_float[sw->info.nchannels == 2]
[sw->info.swap_endianness];
@@ -187,9 +187,9 @@ static int glue (audio_pcm_sw_init_, TYPE) (
sw->clip = mixeng_clip
#endif
[sw->info.nchannels == 2]
- [audio_format_is_signed(hw->info.af)]
+ [audio_format_is_signed(sw->info.af)]
[sw->info.swap_endianness]
- [audio_format_to_index(hw->info.af)];
+ [audio_format_to_index(sw->info.af)];
}
sw->name = g_strdup (name);