X-Git-Url: https://cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fyuv411%2Fyuv411.C;h=7bfd2f441dd1730fea7dfd951643311f88a6c3d3;hb=55b84aa035afd11aed44e4d05c3e6002f5ac79ce;hp=c014ec75f0ff463a15cbc1725460d8926d719066;hpb=54cc56bff09f5004b2a6cd454375f06e56acf5a0;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/yuv411/yuv411.C b/cinelerra-5.1/plugins/yuv411/yuv411.C index c014ec75..7bfd2f44 100644 --- a/cinelerra-5.1/plugins/yuv411/yuv411.C +++ b/cinelerra-5.1/plugins/yuv411/yuv411.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016 Eric Olson + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + #include "clip.h" #include "bccmodels.h" #include "bchash.h" @@ -161,7 +181,7 @@ int yuv411Main::process_realtime(VFrame *input_ptr, VFrame *output_ptr) load_configuration(); int w = input_ptr->get_w(); int h = input_ptr->get_h(); - int colormodel = input_ptr->get_color_model(); + colormodel = input_ptr->get_color_model(); if( input_ptr == output_ptr || ( config.avg_vertical && config.int_horizontal ) ) { @@ -187,11 +207,7 @@ int yuv411Main::process_realtime(VFrame *input_ptr, VFrame *output_ptr) break; } - if( this->colormodel != colormodel ) { - this->colormodel = colormodel; - send_render_gui(this); - } - + send_render_gui(this); return 0; } @@ -221,19 +237,23 @@ void yuv411Main::update_gui() void yuv411Main::render_gui(void *data) { if(thread) { - thread->window->lock_window(); yuv411Window *window = (yuv411Window *)thread->window; yuv411Main *client = (yuv411Main *)data; - switch( client->colormodel ) { - case BC_YUV888: - case BC_YUVA8888: - window->show_warning(0); - break; - default: - window->show_warning(1); - break; + if( window->colormodel != client->colormodel ) { + int warn = 1; + switch( client->colormodel ) { + case BC_YUV888: + case BC_YUVA8888: + warn = 0; + break; + } + if( warn == window->yuv_warning->is_hidden() ) { + window->lock_window("yuv411Main::render_gui"); + window->show_warning(warn); + window->colormodel = client->colormodel; + window->unlock_window(); + } } - window->unlock_window(); } }