From 95a7a58f73728eb027d2bbd3cb819eede4d2ba79 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 3 Apr 2019 17:44:22 +0200 Subject: [PATCH] Fix HTTP tally for the last two channels. Reported by Niall Walsh. --- nageru/mixer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nageru/mixer.cpp b/nageru/mixer.cpp index 5f38a67..ef73b61 100644 --- a/nageru/mixer.cpp +++ b/nageru/mixer.cpp @@ -370,10 +370,10 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards) audio_mixer.reset(new AudioMixer(num_cards, video_inputs.size())); httpd.add_endpoint("/channels", bind(&Mixer::get_channels_json, this), HTTPD::ALLOW_ALL_ORIGINS); - for (int channel_idx = 2; channel_idx < theme->get_num_channels(); ++channel_idx) { + for (int channel_idx = 0; channel_idx < theme->get_num_channels(); ++channel_idx) { char url[256]; - snprintf(url, sizeof(url), "/channels/%d/color", channel_idx); - httpd.add_endpoint(url, bind(&Mixer::get_channel_color_http, this, unsigned(channel_idx)), HTTPD::ALLOW_ALL_ORIGINS); + snprintf(url, sizeof(url), "/channels/%d/color", channel_idx + 2); + httpd.add_endpoint(url, bind(&Mixer::get_channel_color_http, this, unsigned(channel_idx + 2)), HTTPD::ALLOW_ALL_ORIGINS); } // Start listening for clients only once VideoEncoder has written its header, if any. -- 2.39.2