X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fflash%2Fproducer%2Fflash_producer.cpp;h=a93e70f08784c6e5efc6f081e67b715a30bc0e8a;hb=d93b25248f6fe26069350a512f29327ce59fd95b;hp=8f3f957590bd165afb46a2ec07c0494379ae3324;hpb=877caceb5d99f7c51cff8073e06484fbbdec8743;p=casparcg diff --git a/modules/flash/producer/flash_producer.cpp b/modules/flash/producer/flash_producer.cpp index 8f3f95759..a93e70f08 100644 --- a/modules/flash/producer/flash_producer.cpp +++ b/modules/flash/producer/flash_producer.cpp @@ -238,6 +238,11 @@ public: return head_; } + bool is_empty() const + { + return ax_->IsEmpty(); + } + double fps() const { return ax_->GetFPS(); @@ -302,7 +307,7 @@ public: graph_->set_value("output-buffer-count", static_cast(frame_buffer_.size())/static_cast(frame_buffer_.capacity())); auto frame = core::basic_frame::late(); - if(!frame_buffer_.try_pop(frame)) + if(!frame_buffer_.try_pop(frame) && context_) graph_->add_tag("underflow"); return frame; @@ -389,6 +394,12 @@ public: frame_buffer_.push(frame); } + if(context_->is_empty()) + { + context_.reset(nullptr); + return; + } + graph_->set_value("output-buffer-count", static_cast(frame_buffer_.size())/static_cast(frame_buffer_.capacity())); fps_.fetch_and_store(static_cast(context_->fps()*100.0)); graph_->update_text(narrow(print()));