safe_ptr<basic_frame> fill_;\r
safe_ptr<basic_frame> key_;\r
safe_ptr<basic_frame> last_frame_;\r
+ int64_t nb_frames_;\r
\r
explicit separated_producer(const safe_ptr<frame_producer>& fill, const safe_ptr<frame_producer>& key) \r
: fill_producer_(fill)\r
, key_producer_(key)\r
, fill_(core::basic_frame::late())\r
, key_(core::basic_frame::late())\r
- , last_frame_(core::basic_frame::empty()){}\r
- \r
+ , last_frame_(core::basic_frame::empty())\r
+ {\r
+ }\r
// frame_producer\r
\r
virtual safe_ptr<basic_frame> receive(int hints)\r
}\r
);\r
\r
- if(fill_ == basic_frame::eof())\r
+ if(fill_ == basic_frame::eof() || key_ == basic_frame::eof())\r
return basic_frame::eof();\r
\r
if(fill_ == core::basic_frame::late() || key_ == core::basic_frame::late()) // One of the producers is lagging, keep them in sync.\r
{\r
return L"separated";\r
} \r
+\r
+ virtual int64_t nb_frames() const \r
+ {\r
+ return std::min(fill_producer_->nb_frames() > 0 ? fill_producer_->nb_frames() : std::numeric_limits<int64_t>::max(), \r
+ key_producer_->nb_frames() > 0 ? key_producer_->nb_frames() : std::numeric_limits<int64_t>::max());\r
+ }\r
};\r
\r
safe_ptr<frame_producer> create_separated_producer(const safe_ptr<frame_producer>& fill, const safe_ptr<frame_producer>& key)\r