From a0e4b6e26683903065102e5f5b4035eddf4a3a60 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 23 Apr 2012 20:58:15 +0200 Subject: output/alsa: fix out_frame_size formula, multiply with channels The hard-coded "3 bytes" was wrong because it ignored the number of channels. --- src/output/alsa_output_plugin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/output/alsa_output_plugin.c b/src/output/alsa_output_plugin.c index a6dc92fa0..cf3370d01 100644 --- a/src/output/alsa_output_plugin.c +++ b/src/output/alsa_output_plugin.c @@ -674,7 +674,9 @@ alsa_open(struct audio_output *ao, struct audio_format *audio_format, GError **e } ad->in_frame_size = audio_format_frame_size(audio_format); - ad->out_frame_size = ad->export.pack24 ? 3 : ad->in_frame_size; + ad->out_frame_size = ad->export.pack24 + ? (size_t)(audio_format->channels * 3) + : ad->in_frame_size; return true; } -- cgit v1.2.3