aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-04-23 20:58:15 +0200
committerMax Kellermann <max@duempel.org>2012-04-23 21:54:08 +0200
commita0e4b6e26683903065102e5f5b4035eddf4a3a60 (patch)
tree4879316dbab1b6e1e17ff30f5166c0e66475a887
parent0de39b64cbd6834452b5e3c3603aa836aa52d1fb (diff)
output/alsa: fix out_frame_size formula, multiply with channels
The hard-coded "3 bytes" was wrong because it ignored the number of channels.
-rw-r--r--src/output/alsa_output_plugin.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/output/alsa_output_plugin.c b/src/output/alsa_output_plugin.c
index a6dc92fa..cf3370d0 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;
}