]> git.sesse.net Git - nageru/commitdiff
Fix HTTP tally for the last two channels.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 3 Apr 2019 15:44:22 +0000 (17:44 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 4 Apr 2019 07:23:15 +0000 (09:23 +0200)
Reported by Niall Walsh.

nageru/mixer.cpp

index 5f38a673581ccbca276faf9a5d9992dafe06d2f5..ef73b613c0643bae638a3f6533a645ece146ea10 100644 (file)
@@ -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.