implementation(int index, const video_format_desc& format_desc, ogl_device& ogl) \r
: context_(index, ogl, format_desc)\r
, diag_(diagnostics::create_graph(narrow(print())))\r
- , output_(new caspar::core::output(context_))\r
+ , output_(new caspar::core::output(context_, [this]{restart();}))\r
, mixer_(new caspar::core::mixer(context_))\r
, stage_(new caspar::core::stage(context_)) \r
{\r
{\r
CASPAR_LOG_CURRENT_EXCEPTION();\r
CASPAR_LOG(error) << context_.print() << L" Unexpected exception. Clearing stage and freeing memory";\r
-\r
- stage_->clear();\r
- context_.ogl().gc().wait();\r
-\r
- mixer_ = nullptr;\r
- mixer_.reset(new caspar::core::mixer(context_));\r
+ restart();\r
}\r
\r
context_.execution().begin_invoke([this]{tick();});\r
}\r
+\r
+ void restart()\r
+ {\r
+ stage_->clear();\r
+ context_.ogl().gc().wait();\r
+\r
+ mixer_ = nullptr;\r
+ mixer_.reset(new caspar::core::mixer(context_));\r
+ }\r
\r
std::wstring print() const\r
{\r