X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdecklink%2Fconsumer%2Fdecklink_consumer.cpp;h=601d875175c1a61da4864983787a1f73d062de1b;hb=4bcb75c19cd3c8d35f292e456432a5ffbc5e75d8;hp=9ead7d9bbf1ace07d8975cb2e7591d27ad60a771;hpb=be5e83c3f9c90bf26b58eed3225bd9d0e1d9414f;p=casparcg diff --git a/modules/decklink/consumer/decklink_consumer.cpp b/modules/decklink/consumer/decklink_consumer.cpp index 9ead7d9bb..601d87517 100644 --- a/modules/decklink/consumer/decklink_consumer.cpp +++ b/modules/decklink/consumer/decklink_consumer.cpp @@ -169,8 +169,6 @@ public: if(!config.embedded_audio) start_playback(); - - CASPAR_LOG(info) << print() << L" Successfully Initialized."; } ~decklink_consumer() @@ -395,11 +393,20 @@ public: , fail_count_(0) { } + + ~decklink_consumer_proxy() + { + auto str = print(); + context_.reset(); + CASPAR_LOG(info) << str << L" Successfully Uninitialized."; + } virtual void initialize(const core::video_format_desc& format_desc) { format_desc_ = format_desc; - context_.reset([&]{return new decklink_consumer(config_, format_desc_);}); + context_.reset([&]{return new decklink_consumer(config_, format_desc_);}); + + CASPAR_LOG(info) << print() << L" Successfully Initialized."; } virtual bool send(const safe_ptr& frame) @@ -427,7 +434,7 @@ public: virtual std::wstring print() const { - return context_->print(); + return context_ ? context_->print() : L"decklink_consumer"; } virtual bool key_only() const