From ff59340614ec150e4bd84d3554081e666970aef2 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 3 May 2013 18:25:26 +0100 Subject: elusive hang while rendering --- rotord/rotor.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'rotord/rotor.cpp') diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp index b0bf8ab..4c79fc1 100755 --- a/rotord/rotor.cpp +++ b/rotord/rotor.cpp @@ -13,6 +13,9 @@ Node_factory::Node_factory(){ add_type("testcard",new Testcard()); add_type("video_output",new Video_output()); add_type("video_input",new Video_input()); + add_type("on_off",new On_off()); + add_type("invert",new Invert()); + add_type("video_cycler",new Video_cycler()); } bool Signal_input::connect(Signal_node* source) { @@ -151,7 +154,7 @@ void Audio_analysis::print_features(){ } } -bool Video_output::render(const float duration, const float framerate,const string &output_filename,const string &audio_filename){ +bool Video_output::render(const float duration, const float framerate,const string &output_filename,const string &audio_filename,float& progress){ // //setup defaults @@ -188,8 +191,15 @@ bool Video_output::render(const float duration, const float framerate,const stri af+=exporter->get_audio_step(); } Image* i=get_output(Frame_spec(vf,framerate,outW,outH)); - exporter->encodeFrame(i->RGBdata); + if (i) { + exporter->encodeFrame(i->RGBdata); + } vf+=vstep; + progress=vf/duration; + if (progress>0.99) { + //stop here + //seems that the last frame of samples causes std::max to have + } /* if (!exporter->encodeFrame(i->RGBdata)){ //if (!exporter->encodeFrame(get_output(Frame_spec(f,framerate,outW,outH))->RGBdata,audioloader.get_packet())){ -- cgit v1.2.3