Fix auto-WB of certain kinds of input.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Feb 2020 16:54:57 +0000 (17:54 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Feb 2020 16:54:57 +0000 (17:54 +0100)
nageru/theme.cpp

index f3e1aa1..162c3bc 100644 (file)
@@ -1686,9 +1686,11 @@ bool Theme::get_supports_set_wb(unsigned channel)
 
 void Theme::set_wb(unsigned channel, float r, float g, float b)
 {
+       int signal = get_channel_signal(channel);
+
        lock_guard<mutex> lock(m);
-       if (channel_signals.count(channel)) {
-               white_balance_for_signal[channel_signals[channel]] = RGBTriplet{ r, g, b };
+       if (signal != -1) {
+               white_balance_for_signal[signal] = RGBTriplet{ r, g, b };
        }
 
        call_lua_wb_callback(channel, r, g, b);