aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-24 16:01:07 +0100
committerMax Kellermann <max@duempel.org>2014-12-24 16:10:27 +0100
commit39a5be2df9e1d0b38bb815669220c605cfba61fb (patch)
treea34ceb85fcda72fb022856ac8f8c3af4176f5b91
parent96560e317a55fac0ef5f65c5e27cee95e328358a (diff)
downloadmpd-39a5be2df9e1d0b38bb815669220c605cfba61fb.tar.gz
mpd-39a5be2df9e1d0b38bb815669220c605cfba61fb.tar.xz
mpd-39a5be2df9e1d0b38bb815669220c605cfba61fb.zip
output/jack: merge two mpd_jack_available() calls
-rw-r--r--src/output/plugins/JackOutputPlugin.cxx4
1 files 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;