X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_decoder.cc;h=765b9fa62b127976d000ff70ee68b2b8ba514fd8;hb=refs%2Ftags%2Fv2.17.0;hp=d4a5d6c192884872dd35ca260576be73e4690418;hpb=f1263cd43ad761e63047baf7c674f5de04c0139c;p=dcpomatic.git diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index d4a5d6c19..765b9fa62 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -143,11 +143,10 @@ FFmpegDecoder::flush () full_length = full_length.ceil (frc.source); if (video) { double const vfr = _ffmpeg_content->video_frame_rate().get(); - auto const f = full_length.frames_round (vfr); - auto v = video->position(film()).get_value_or(ContentTime()).frames_round(vfr) + 1; - while (v < f) { - video->emit (film(), make_shared(_black_image), v); - ++v; + auto v = video->position(film()).get_value_or(ContentTime()) + ContentTime::from_frames(1, vfr); + while (v < full_length) { + video->emit(film(), make_shared(_black_image), v); + v += ContentTime::from_frames(1, vfr); } } @@ -611,7 +610,7 @@ FFmpegDecoder::process_video_frame () video->emit ( film(), make_shared(image), - llrint(pts * _ffmpeg_content->active_video_frame_rate(film())) + ContentTime::from_seconds(pts) ); } else { LOG_WARNING_NC ("Dropping frame without PTS");