Further fixes and tidying to 'better-seek'.
[dcpomatic.git] / src / lib / video_decoder.cc
index 1cde53e8140584b145743c69a26d0c4220fe251d..0e9ee0c1a874d1e9ffe1f7e0531b15369f431d83 100644 (file)
@@ -274,6 +274,7 @@ VideoDecoder::give (shared_ptr<const ImageProxy> image, Frame frame)
        }
 
        _log->log (String::compose ("VD receives %1", frame), LogEntry::TYPE_DEBUG_DECODE);
+       _position = ContentTime::from_frames (frame, _content->active_video_frame_rate());
 
        /* Work out what we are going to push into _decoded next */
        list<ContentVideo> to_push;
@@ -389,4 +390,5 @@ VideoDecoder::seek (ContentTime s, bool accurate)
        _decoded.clear ();
        _last_seek_time = s;
        _last_seek_accurate = accurate;
+       _position.reset ();
 }