From 39a5be2df9e1d0b38bb815669220c605cfba61fb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 24 Dec 2014 16:01:07 +0100 Subject: output/jack: merge two mpd_jack_available() calls --- src/output/plugins/JackOutputPlugin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx index f24325630..fb850edb1 100644 --- a/src/output/plugins/JackOutputPlugin.cxx +++ b/src/output/plugins/JackOutputPlugin.cxx @@ -116,10 +116,11 @@ mpd_jack_process(jack_nframes_t nframes, void *arg) if (nframes <= 0) return 0; + jack_nframes_t available = mpd_jack_available(jd); + if (jd->pause) { /* empty the ring buffers */ - const jack_nframes_t available = mpd_jack_available(jd); for (unsigned i = 0; i < jd->audio_format.channels; ++i) jack_ringbuffer_read_advance(jd->ringbuffer[i], available * jack_sample_size); @@ -138,7 +139,6 @@ mpd_jack_process(jack_nframes_t nframes, void *arg) return 0; } - jack_nframes_t available = mpd_jack_available(jd); if (available > nframes) available = nframes; -- cgit v1.2.3