]> git.sesse.net Git - movit/commitdiff
Assert that the EffectChain is not finalized when someone tries to modify it.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 24 Dec 2013 00:51:42 +0000 (01:51 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 24 Dec 2013 00:51:42 +0000 (01:51 +0100)
effect_chain.cpp

index 574c44e2a68a0c7dac6e5ff43693a628c7ae61af..e68895d7b8f40c8c30475b8f51e0e49c7f39a473 100644 (file)
@@ -55,6 +55,7 @@ EffectChain::~EffectChain()
 
 Input *EffectChain::add_input(Input *input)
 {
+       assert(!finalized);
        inputs.push_back(input);
        add_node(input);
        return input;
@@ -62,6 +63,7 @@ Input *EffectChain::add_input(Input *input)
 
 void EffectChain::add_output(const ImageFormat &format, OutputAlphaFormat alpha_format)
 {
+       assert(!finalized);
        output_format = format;
        output_alpha_format = alpha_format;
 }
@@ -157,6 +159,7 @@ void EffectChain::find_all_nonlinear_inputs(Node *node, std::vector<Node *> *non
 
 Effect *EffectChain::add_effect(Effect *effect, const std::vector<Effect *> &inputs)
 {
+       assert(!finalized);
        assert(inputs.size() == effect->num_inputs());
        Node *node = add_node(effect);
        for (unsigned i = 0; i < inputs.size(); ++i) {