From 41c9c9d56791fe9bb67d6f2b1cea2a8f583f4262 Mon Sep 17 00:00:00 2001 From: hellgore Date: Thu, 17 Jan 2013 13:58:22 +0000 Subject: [PATCH] Simplified bluefish_consumer git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/trunk@3682 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- .../bluefish/consumer/bluefish_consumer.cpp | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/modules/bluefish/consumer/bluefish_consumer.cpp b/modules/bluefish/consumer/bluefish_consumer.cpp index 950c39b06..3e094e76d 100644 --- a/modules/bluefish/consumer/bluefish_consumer.cpp +++ b/modules/bluefish/consumer/bluefish_consumer.cpp @@ -188,12 +188,8 @@ public: boost::unique_future send(const safe_ptr& frame) { - auto display_command = [=] + return executor_.begin_invoke([=]() -> bool { - // The executor queue now has room so we try to complete the pending send call - send_completion_.try_or_fail( - caspar_exception() << msg_info(narrow(print()) + " Future send not able to complete.")); - try { display_frame(frame); @@ -204,22 +200,9 @@ public: { CASPAR_LOG_CURRENT_EXCEPTION(); } - }; - - auto enqueue_command = [=] - { - return executor_.try_begin_invoke(display_command); - }; - if (enqueue_command()) - return wrap_as_future(true); - - send_completion_.set_task([=] - { - return enqueue_command() ? boost::optional(true) : boost::optional(); + return true; }); - - return std::move(send_completion_.get_future()); } void display_frame(const safe_ptr& frame) -- 2.39.2