]> git.sesse.net Git - casparcg/blobdiff - modules/bluefish/consumer/bluefish_consumer.cpp
2.0. stage: Changed error handling.
[casparcg] / modules / bluefish / consumer / bluefish_consumer.cpp
index ab73cac358894d64ae3f9cf412d7e29f65185888..d04fc435135519a8bb5a273ae4f0bbf397b3ae6b 100644 (file)
@@ -319,14 +319,12 @@ struct bluefish_consumer_proxy : public core::frame_consumer
        const bool                                                      embedded_audio_;\r
        const bool                                                      key_only_;\r
        core::video_format_desc                         format_desc_;\r
-       size_t                                                          fail_count_;\r
 public:\r
 \r
        bluefish_consumer_proxy(size_t device_index, bool embedded_audio, bool key_only)\r
                : device_index_(device_index)\r
                , embedded_audio_(embedded_audio)\r
                , key_only_(key_only)\r
-               , fail_count_(0)\r
        {\r
        }\r
        \r
@@ -338,24 +336,7 @@ public:
        \r
        virtual bool send(const safe_ptr<core::read_frame>& frame)\r
        {\r
-               if(!consumer_)\r
-                       consumer_.reset(new bluefish_consumer(format_desc_, device_index_, embedded_audio_, key_only_));\r
-\r
-               try\r
-               {\r
-                       consumer_->send(frame);\r
-                       fail_count_ = 0;\r
-               }\r
-               catch(...)\r
-               {\r
-                       consumer_.reset();\r
-\r
-                       if(fail_count_++ > 3)\r
-                               return false;  // Outside didn't handle exception properly, just give up.\r
-\r
-                       throw;\r
-               }\r
-\r
+               consumer_->send(frame);\r
                return true;\r
        }\r
 \r