From: Steinar H. Gunderson Date: Mon, 20 Feb 2017 20:44:33 +0000 (+0100) Subject: Fix compiling without C++11. X-Git-Tag: 1.5.0~10 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=f0d64ec5bf2e3ccfc20d7cfe8a6843b32d07ffad Fix compiling without C++11. ABI break. Reported by Dan Dennedy. --- diff --git a/effect_chain.cpp b/effect_chain.cpp index 4d13d3f..10573ef 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -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 diff --git a/effect_chain.h b/effect_chain.h index 7e0cd9f..c5178bb 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -492,6 +492,7 @@ private: std::vector nodes; std::map node_map; Effect *dither_effect; + Node *ycbcr_conversion_effect_node; std::vector inputs; // Also contained in nodes. std::vector phases;