safe_ptr() : impl_(std::make_shared<T>()){} \r
\r
safe_ptr(const safe_ptr<T>& other) : impl_(other.impl_){} // noexcept\r
- \r
+ safe_ptr(safe_ptr<T>&& other) : impl_(std::move(other.impl_)){}\r
+\r
template<typename U>\r
safe_ptr(const safe_ptr<U>& other, typename std::enable_if<std::is_convertible<U*, T*>::value, void*>::type = 0) : impl_(other.impl_){} // noexcept\r
\r
\r
#define CASPAR_ASSERT_EXPR_STR(str) #str\r
\r
-#define CASPAR_ASSERT(expr) do{if(!(expr)) CASPAR_LOG(warning) << "\n\nAssertion Failed:\n" << \\r
+#define CASPAR_ASSERT(expr) do{if(!(expr)){ CASPAR_LOG(warning) << "\n\nAssertion Failed:\n" << \\r
CASPAR_ASSERT_EXPR_STR(expr) << "\n" \\r
__FILE__ << "\n"; \\r
_CASPAR_DBG_BREAK;\\r
- }while(0);
\ No newline at end of file
+ }}while(0);
\ No newline at end of file
virtual size_t buffer_depth() const = 0;\r
virtual void initialize(const video_format_desc& format_desc) = 0;\r
\r
- static safe_ptr<frame_consumer> empty()\r
+ static const safe_ptr<frame_consumer>& empty()\r
{\r
struct empty_frame_consumer : public frame_consumer\r
{\r
<ClCompile Include="producer\layer.cpp">\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PreprocessToFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PreprocessToFile>\r
</ClCompile>\r
<ClCompile Include="producer\transition\transition_producer.cpp">\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
////////////////////////////////////////////////////////////////////////////////////////////////////\r
virtual void initialize(const safe_ptr<frame_factory>& frame_factory) = 0;\r
\r
- static safe_ptr<frame_producer> empty() // nothrow\r
+ static const safe_ptr<frame_producer>& empty() // nothrow\r
{\r
struct empty_frame_producer : public frame_producer\r
{\r
if(is_paused_)\r
return last_frame_;\r
\r
- if(foreground_ == frame_producer::empty())\r
- {\r
- last_frame_ = draw_frame::empty();\r
- return last_frame_;\r
- }\r
-\r
try\r
{\r
last_frame_ = foreground_->receive(); \r
last_frame_->set_layer_index(index_);\r
if(last_frame_ == draw_frame::eof())\r
{\r
+ CASPAR_ASSERT(foreground_ != frame_producer::empty());\r
+\r
auto following = foreground_->get_following_producer();\r
following->set_leading_producer(foreground_);\r
foreground_ = following;\r
\r
static safe_ptr<draw_frame> interlace(const safe_ptr<draw_frame>& frame1, const safe_ptr<draw_frame>& frame2, video_mode::type mode);\r
\r
- static safe_ptr<draw_frame> eof()\r
+ static const safe_ptr<draw_frame>& eof()\r
{\r
struct eof_frame : public draw_frame{};\r
static safe_ptr<draw_frame> frame = make_safe<eof_frame>();\r
return frame;\r
}\r
\r
- static safe_ptr<draw_frame> empty()\r
+ static const safe_ptr<draw_frame>& empty()\r
{\r
struct empty_frame : public draw_frame{};\r
static safe_ptr<draw_frame> frame = make_safe<empty_frame>();\r