Don't trust video timestamps from FFmpegDecoder.
[dcpomatic.git] / src / lib / ffmpeg_decoder.cc
index 0f39f7727348eadfd124689e5e1e858ab50c0ef6..fd248c39a67a0b319a3ddc0cb910ad2bc3d02920 100644 (file)
@@ -126,7 +126,7 @@ FFmpegDecoder::flush ()
        if (video) {
                double const vfr = _ffmpeg_content->video_frame_rate().get();
                Frame const f = full_length.frames_round (vfr);
-               Frame v = video->position(film()).frames_round(vfr) + 1;
+               Frame v = video->position(film()).get_value_or(ContentTime()).frames_round(vfr) + 1;
                while (v < f) {
                        video->emit (film(), shared_ptr<const ImageProxy> (new RawImageProxy (_black_image)), v);
                        ++v;