Merge.
[dcpomatic.git] / src / lib / video_decoder.cc
index cba21d280aae20a51fff025cb470fde6d3f5cb10..a5147f42ece1a450ec946681f659ab8435793eb5 100644 (file)
@@ -67,7 +67,7 @@ VideoDecoder::video (shared_ptr<Image> image, bool same, Time t)
        }
 
        if (sub) {
-               Rect const tx = subtitle_transformed_area (
+               dcpomatic::Rect const tx = subtitle_transformed_area (
                        float (image_size.width) / video_size().width,
                        float (image_size.height) / video_size().height,
                        sub->area(), film->subtitle_offset(), film->subtitle_scale()
@@ -112,3 +112,12 @@ VideoDecoder::subtitle (shared_ptr<TimedSubtitle> s)
                _timed_subtitle->subtitle()->set_position (Position (p.x - _video_content->crop().left, p.y - _video_content->crop().top));
        }
 }
+
+bool
+VideoDecoder::video_done () const
+{
+       shared_ptr<const Film> film = _film.lock ();
+       assert (film);
+       
+       return (_video_content->length() - _next_video) < film->video_frames_to_time (1);
+}