From 0279f4fb5778157c25fcbd9189f88b88d8557cad Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 8 Aug 2022 22:01:56 +0200 Subject: [PATCH] output/jack: fix bogus assertion failure Regression from commit 45071607aa277dbbf3814e9a06c8371be75f27c5 Closes https://github.com/MusicPlayerDaemon/MPD/issues/1571 --- src/output/plugins/JackOutputPlugin.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx index 31f15a70d..3667e5729 100644 --- a/src/output/plugins/JackOutputPlugin.cxx +++ b/src/output/plugins/JackOutputPlugin.cxx @@ -693,13 +693,13 @@ JackOutput::WriteSamples(const float *src, size_t n_frames) std::size_t JackOutput::Play(std::span _src) { + const size_t frame_size = audio_format.GetFrameSize(); + assert(_src.size() % frame_size == 0); + const auto src = FromBytesStrict(_src); pause = false; - const size_t frame_size = audio_format.GetFrameSize(); - assert(src.size() % frame_size == 0); - const std::size_t n_frames = src.size() / audio_format.channels; while (true) {