\r
return frame;\r
}\r
+\r
+ draw_frame last_frame() const\r
+ {\r
+ return draw_frame::mask(fill_producer_->last_frame(), key_producer_->last_frame());\r
+ }\r
\r
uint32_t nb_frames() const override\r
{\r
\r
return compose(dest, source);\r
}\r
+\r
+ draw_frame last_frame() const override\r
+ {\r
+ if(current_frame_ >= info_.duration)\r
+ return dest_producer_->last_frame();\r
+\r
+ return frame_producer_base::last_frame();\r
+ }\r
\r
uint32_t nb_frames() const override\r
{\r
\r
// transition_producer\r
\r
- draw_frame compose(draw_frame dest_frame, draw_frame src_frame) \r
+ draw_frame compose(draw_frame dest_frame, draw_frame src_frame) const\r
{ \r
if(info_.type == transition_type::cut) \r
return src_frame;\r
muxer_.clear();\r
\r
// BEGIN HACK: There is no way to flush yadif. Need to poll 2 frames.\r
- for(int n = 0; n < 25 && file_frame_number() != target+2; ++n)\r
+ for(int n = 0; n < 25 && file_frame_number() != target+3; ++n)\r
{\r
decode_next_frame();\r
if(!muxer_.empty())\r
+ {\r
+ last_frame_ = std::move(muxer_.front());\r
muxer_.pop();\r
+ }\r
}\r
- // END HACK\r
-\r
- decode_next_frame();\r
-\r
- last_frame_ = !muxer_.empty() ? muxer_.front() : last_frame_; \r
+ // END HACK \r
}\r
\r
std::wstring print_mode() const\r
\r
#include <common/diagnostics/graph.h>\r
#include <common/executor.h>\r
+#include <common/lock.h>\r
#include <common/except.h>\r
#include <common/log.h>\r
\r
\r
void seek(uint32_t target)\r
{\r
- seek_target_ = target;\r
- video_stream_.clear();\r
- audio_stream_.clear();\r
+ {\r
+ boost::lock_guard<boost::mutex> lock(mutex_);\r
+\r
+ seek_target_ = target;\r
+ video_stream_.clear();\r
+ audio_stream_.clear();\r
+ eof_ = false;\r
+ }\r
\r
- eof_ = false;\r
cond_.notify_one();\r
}\r
\r
\r
while(is_running_)\r
{\r
- boost::unique_lock<boost::mutex> lock(mutex_);\r
\r
try\r
{\r
- tick();\r
-\r
boost::this_thread::sleep(boost::posix_time::milliseconds(1));\r
\r
- while((full() || eof_) && is_running_)\r
- cond_.wait(lock);\r
+ {\r
+ boost::unique_lock<boost::mutex> lock(mutex_);\r
+\r
+ while((full() || eof_) && is_running_)\r
+ cond_.wait(lock);\r
+ \r
+ tick();\r
+ }\r
}\r
catch(...)\r
{\r
</flash>\r
<channels>\r
<channel>\r
- <video-mode>1080p5000</video-mode>\r
+ <video-mode>PAL</video-mode>\r
<consumers>\r
<screen>\r
<device>1</device>\r