X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fvideo_channel.cpp;h=476a73eb32190af8e0f2ba8954ebe2eb1a49829e;hb=07ea8ea982ca19ebbfcf21bb575e107fc0495588;hp=267a821dbd50723cbc53edddbb2e18bdb2a5c2ae;hpb=f054618ec557df435df17047f6d72b5d36e4b496;p=casparcg diff --git a/core/video_channel.cpp b/core/video_channel.cpp index 267a821db..476a73eb3 100644 --- a/core/video_channel.cpp +++ b/core/video_channel.cpp @@ -59,7 +59,7 @@ public: implementation(int index, const video_format_desc& format_desc, ogl_device& ogl) : context_(index, ogl, format_desc) , diag_(diagnostics::create_graph(narrow(print()))) - , output_(new caspar::core::output(context_)) + , output_(new caspar::core::output(context_, [this]{restart();})) , mixer_(new caspar::core::mixer(context_)) , stage_(new caspar::core::stage(context_)) { @@ -118,16 +118,20 @@ public: { CASPAR_LOG_CURRENT_EXCEPTION(); CASPAR_LOG(error) << context_.print() << L" Unexpected exception. Clearing stage and freeing memory"; - - stage_->clear(); - context_.ogl().gc().wait(); - - mixer_ = nullptr; - mixer_.reset(new caspar::core::mixer(context_)); + restart(); } context_.execution().begin_invoke([this]{tick();}); } + + void restart() + { + stage_->clear(); + context_.ogl().gc().wait(); + + mixer_ = nullptr; + mixer_.reset(new caspar::core::mixer(context_)); + } std::wstring print() const {