aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-04-23 21:12:27 +0200
committerMax Kellermann <max@duempel.org>2012-04-23 21:54:09 +0200
commit89377556cdd20bdc8cdb5861f271164b1cba6ecf (patch)
treef59b61f32b6ba499efcebed2fd961fbc467bf444
parentec931143479e67042d2393435b2f4e91235edae6 (diff)
downloadmpd-89377556cdd20bdc8cdb5861f271164b1cba6ecf.tar.gz
mpd-89377556cdd20bdc8cdb5861f271164b1cba6ecf.tar.xz
mpd-89377556cdd20bdc8cdb5861f271164b1cba6ecf.zip
output/alsa: multiply writei() result with out_frame_size
.. and not in_frame_size, because this relates to the frame size being sent to ALSA. pcm_export_source_size() will then turn it back into the in_frame_size scale.
-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 5107d0a94..d8b184273 100644
--- a/src/output/alsa_output_plugin.c
+++ b/src/output/alsa_output_plugin.c
@@ -787,8 +787,10 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size,
if (ret > 0) {
ad->period_position = (ad->period_position + ret)
% ad->period_frames;
+
+ size_t bytes_written = ret * ad->out_frame_size;
return pcm_export_source_size(&ad->export,
- ret * ad->in_frame_size);
+ bytes_written);
}
if (ret < 0 && ret != -EAGAIN && ret != -EINTR &&