From 4a80e9cb2580a8be155a75117a6f52b8d267cdf6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Feb 2017 22:23:00 +0100 Subject: [PATCH] output/alsa: copy the PcmExport result to the ring_buffer .. and not the input data. Regression from commit b1c7649edb80 (integer underflow). https://bugs.musicpd.org/view.php?id=4639 --- src/output/plugins/AlsaOutputPlugin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index 39f3e8bd1..01dea36ca 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -1201,8 +1201,8 @@ AlsaOutput::Play(const void *chunk, size_t size) if (error) std::rethrow_exception(error); - size_t bytes_written = ring_buffer->push((const uint8_t *)chunk, - size); + size_t bytes_written = ring_buffer->push((const uint8_t *)e.data, + e.size); if (bytes_written > 0) return pcm_export->CalcSourceSize(bytes_written);