]> git.sesse.net Git - movit/commitdiff
Fix a bug where find_nonlinear_inputs() would choke on GammaCompressionEffect and...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Oct 2012 17:06:21 +0000 (19:06 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Oct 2012 17:06:21 +0000 (19:06 +0200)
effect_chain.cpp

index cfc6d06431f46631302b22f9d7693bcf79dab15b..1dcc463bf5028ef6e4363d34973a82cbd353f92d 100644 (file)
@@ -111,7 +111,8 @@ void EffectChain::insert_node_between(Node *sender, Node *middle, Node *receiver
 
 void EffectChain::find_all_nonlinear_inputs(Node *node, std::vector<Node *> *nonlinear_inputs)
 {
-       if (node->output_gamma_curve == GAMMA_LINEAR) {
+       if (node->output_gamma_curve == GAMMA_LINEAR &&
+           node->effect->effect_type_id() != "GammaCompressionEffect") {
                return;
        }
        if (node->effect->num_inputs() == 0) {
@@ -744,6 +745,7 @@ void EffectChain::fix_internal_gamma_by_asking_inputs(unsigned step)
                        // See if all inputs can give us linear gamma. If not, leave it.
                        std::vector<Node *> nonlinear_inputs;
                        find_all_nonlinear_inputs(node, &nonlinear_inputs);
+                       assert(!nonlinear_inputs.empty());
 
                        bool all_ok = true;
                        for (unsigned i = 0; i < nonlinear_inputs.size(); ++i) {