aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-24 23:04:29 +0100
committerMax Kellermann <max@duempel.org>2014-12-24 23:04:29 +0100
commitca88fc4ed3e66dc99584466e8ab16c7a4ba26645 (patch)
treeb3e2e76bdfca5b8c5a00ecca678c063f814f792b /src
parentb83a1d79b78265ff197f2677790eb34eb3bf7aae (diff)
downloadmpd-ca88fc4ed3e66dc99584466e8ab16c7a4ba26645.tar.gz
mpd-ca88fc4ed3e66dc99584466e8ab16c7a4ba26645.tar.xz
mpd-ca88fc4ed3e66dc99584466e8ab16c7a4ba26645.zip
output/jack: cache AudioFormat::channels
Diffstat (limited to 'src')
-rw-r--r--src/output/plugins/JackOutputPlugin.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx
index 2872e27aa..c10d76b7e 100644
--- a/src/output/plugins/JackOutputPlugin.cxx
+++ b/src/output/plugins/JackOutputPlugin.cxx
@@ -643,15 +643,14 @@ mpd_jack_delay(AudioOutput *ao)
inline size_t
JackOutput::WriteSamples(const float *src, size_t n_frames)
{
+ const unsigned n_channels = audio_format.channels;
const size_t result = n_frames;
- while (n_frames-- > 0) {
- for (unsigned i = 0; i < audio_format.channels; ++i, ++src) {
+ while (n_frames-- > 0)
+ for (unsigned i = 0; i < n_channels; ++i, ++src)
jack_ringbuffer_write(ringbuffer[i],
(const char *)src,
sizeof(*src));
- }
- }
return result;
}