From: Steinar H. Gunderson Date: Wed, 3 Apr 2019 15:44:22 +0000 (+0200) Subject: Fix HTTP tally for the last two channels. X-Git-Tag: 1.8.6~5 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=95a7a58f73728eb027d2bbd3cb819eede4d2ba79 Fix HTTP tally for the last two channels. Reported by Niall Walsh. --- 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.