@@ -542,8 +542,7 @@ struct AVProducer::Impl
542542 std::string afilter_;
543543 std::string vfilter_;
544544
545- boost::optional<bool > seekable_;
546-
545+ int seekable_ = 2 ;
547546 int64_t frame_count_ = 0 ;
548547 bool frame_flush_ = true ;
549548 int64_t frame_time_ = AV_NOPTS_VALUE;
@@ -570,18 +569,19 @@ struct AVProducer::Impl
570569 boost::optional<int64_t > start,
571570 boost::optional<int64_t > duration,
572571 bool loop,
573- boost::optional< bool > seekable)
572+ int seekable)
574573 : frame_factory_(frame_factory)
575574 , format_desc_(format_desc)
576575 , format_tb_({format_desc.duration , format_desc.time_scale })
577576 , name_(name)
578577 , path_(path)
579- , input_(path, graph_, seekable)
578+ , input_(path, graph_, seekable >= 0 && seekable < 2 ? boost::optional< bool >( false ) : boost::optional< bool >() )
580579 , start_(start ? av_rescale_q(*start, format_tb_, TIME_BASE_Q) : AV_NOPTS_VALUE)
581580 , duration_(duration ? av_rescale_q(*duration, format_tb_, TIME_BASE_Q) : AV_NOPTS_VALUE)
582581 , loop_(loop)
583582 , afilter_(afilter)
584583 , vfilter_(vfilter)
584+ , seekable_(seekable)
585585 {
586586 diagnostics::register_graph (graph_);
587587 graph_->set_color (" underflow" , diagnostics::color (0 .6f , 0 .3f , 0 .9f ));
@@ -593,6 +593,8 @@ struct AVProducer::Impl
593593 state_[" loop" ] = loop;
594594 update_state ();
595595
596+ CASPAR_LOG (debug) << print () << " seekable: " << seekable_;
597+
596598 thread_ = boost::thread ([=] {
597599 try {
598600 run ();
@@ -994,10 +996,9 @@ struct AVProducer::Impl
994996 time = time + (input_->start_time != AV_NOPTS_VALUE ? input_->start_time : 0 );
995997
996998 // TODO (fix) Dont seek if time is close future.
997- if (!seekable_ || * seekable_) {
999+ if (seekable_) {
9981000 input_.seek (time);
9991001 }
1000-
10011002 frame_flush_ = true ;
10021003 frame_count_ = 0 ;
10031004 buffer_eof_ = false ;
@@ -1053,7 +1054,7 @@ AVProducer::AVProducer(std::shared_ptr<core::frame_factory> frame_factory,
10531054 boost::optional<int64_t > start,
10541055 boost::optional<int64_t > duration,
10551056 boost::optional<bool > loop,
1056- boost::optional< bool > seekable)
1057+ int seekable)
10571058 : impl_(new Impl(std::move(frame_factory),
10581059 std::move (format_desc),
10591060 std::move(name),
0 commit comments