]> git.sesse.net Git - movit/commitdiff
Fix compiling without C++11.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 20 Feb 2017 20:44:33 +0000 (21:44 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 20 Feb 2017 20:44:33 +0000 (21:44 +0100)
ABI break. Reported by Dan Dennedy.

effect_chain.cpp
effect_chain.h

index 4d13d3f8d30c6f24c0520f4c4633e864b9d12904..10573ef8aba7ac58cf4c037db15552321e494cad 100644 (file)
@@ -38,6 +38,7 @@ EffectChain::EffectChain(float aspect_nom, float aspect_denom, ResourcePool *res
          output_color_rgba(false),
          output_color_ycbcr(false),
          dither_effect(NULL),
+         ycbcr_conversion_effect_node(NULL),
          intermediate_format(GL_RGBA16F),
          intermediate_transformation(NO_FRAMEBUFFER_TRANSFORMATION),
          num_dither_bits(0),
@@ -122,14 +123,8 @@ void EffectChain::change_ycbcr_output_format(const YCbCrFormat &ycbcr_format)
 
        output_ycbcr_format = ycbcr_format;
        if (finalized) {
-               // Find the YCbCrConversionEffect node. We don't store it to avoid
-               // an unneeded ABI break (this can be fixed on next break).
-               for (Node *node : nodes) {
-                       if (node->effect->effect_type_id() == "YCbCrConversionEffect") {
-                               YCbCrConversionEffect *effect = (YCbCrConversionEffect *)(node->effect);
-                               effect->change_output_format(ycbcr_format);
-                       }
-               }
+               YCbCrConversionEffect *effect = (YCbCrConversionEffect *)(ycbcr_conversion_effect_node->effect);
+               effect->change_output_format(ycbcr_format);
        }
 }
 
@@ -1622,8 +1617,8 @@ void EffectChain::add_ycbcr_conversion_if_needed()
                return;
        }
        Node *output = find_output_node();
-       Node *ycbcr = add_node(new YCbCrConversionEffect(output_ycbcr_format));
-       connect_nodes(output, ycbcr);
+       ycbcr_conversion_effect_node = add_node(new YCbCrConversionEffect(output_ycbcr_format));
+       connect_nodes(output, ycbcr_conversion_effect_node);
 }
        
 // If the user has requested dither, add a DitherEffect right at the end
index 7e0cd9f97b9b6465ea46b38908f7213aa1f2664c..c5178bbb60d7261d739fca490b1f17e730785c01 100644 (file)
@@ -492,6 +492,7 @@ private:
        std::vector<Node *> nodes;
        std::map<Effect *, Node *> node_map;
        Effect *dither_effect;
+       Node *ycbcr_conversion_effect_node;
 
        std::vector<Input *> inputs;  // Also contained in nodes.
        std::vector<Phase *> phases;