Skip to content

Commit

Permalink
fix: #963 LOADBG with AUTO not working after seeking forward (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian authored and ronag committed May 15, 2018
1 parent abdbcc1 commit c28f7d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/modules/ffmpeg/producer/av_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,10 @@ struct AVProducer::Impl

boost::optional<int64_t> duration() const
{
if (duration_ != AV_NOPTS_VALUE) {
return av_rescale_q(duration_, TIME_BASE_Q, format_tb_);
}

if (!input_.duration()) {
return boost::none;
}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/ffmpeg/producer/ffmpeg_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ struct ffmpeg_producer : public core::frame_producer_base

std::uint32_t frame_number() const override
{
return static_cast<std::uint32_t>(producer_->time() * format_desc_.fps);
return static_cast<std::uint32_t>(producer_->time());
}

std::uint32_t nb_frames() const override
{
return producer_->loop() ? std::numeric_limits<std::uint32_t>::max()
: static_cast<std::uint32_t>(producer_->duration() * format_desc_.fps);
: static_cast<std::uint32_t>(producer_->duration());
}

std::future<std::wstring> call(const std::vector<std::wstring>& params) override
Expand Down

0 comments on commit c28f7d4

Please sign in to comment.