+/** @return true if this PlayerVideo is definitely the same as another, false if it is probably not */
+bool
+PlayerVideo::same (shared_ptr<const PlayerVideo> other) const
+{
+ if (_crop != other->_crop ||
+ _fade != other->_fade ||
+ _inter_size != other->_inter_size ||
+ _out_size != other->_out_size ||
+ _eyes != other->_eyes ||
+ _part != other->_part ||
+ _colour_conversion != other->_colour_conversion ||
+ _video_range != other->_video_range) {
+ return false;
+ }
+
+ if ((!_text && other->_text) || (_text && !other->_text)) {
+ /* One has a text and the other doesn't */
+ return false;
+ }
+
+ if (_text && other->_text && !_text->same (other->_text.get ())) {
+ /* They both have texts but they are different */
+ return false;
+ }
+
+ /* Now neither has subtitles */
+
+ return _in->same (other->_in);
+}
+
+AVPixelFormat
+PlayerVideo::force (AVPixelFormat, AVPixelFormat force_to)
+{
+ return force_to;
+}
+
+AVPixelFormat
+PlayerVideo::keep_xyz_or_rgb (AVPixelFormat p)
+{
+ return p == AV_PIX_FMT_XYZ12LE ? AV_PIX_FMT_XYZ12LE : AV_PIX_FMT_RGB48LE;
+}
+
+void
+PlayerVideo::prepare (function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast)
+{
+ _in->prepare (_inter_size);
+ boost::mutex::scoped_lock lm (_mutex);
+ if (!_image) {
+ make_image (pixel_format, aligned, fast);
+ }
+}
+
+size_t
+PlayerVideo::memory_used () const
+{
+ return _in->memory_used();
+}
+
+/** @return Shallow copy of this; _in and _text are shared between the original and the copy */
+shared_ptr<PlayerVideo>
+PlayerVideo::shallow_copy () const
+{
+ return shared_ptr<PlayerVideo>(
+ new PlayerVideo(
+ _in,
+ _crop,
+ _fade,
+ _inter_size,
+ _out_size,
+ _eyes,
+ _part,
+ _colour_conversion,
+ _video_range,
+ _content,
+ _video_frame
+ )
+ );
+}
+
+/** Re-read crop, fade, inter/out size, colour conversion and video range from our content.
+ * @return true if this was possible, false if not.
+ */
+bool
+PlayerVideo::reset_metadata (shared_ptr<const Film> film, dcp::Size video_container_size, dcp::Size film_frame_size)
+{
+ shared_ptr<Content> content = _content.lock();
+ if (!content || !_video_frame) {
+ return false;
+ }
+
+ _crop = content->video->crop();
+ _fade = content->video->fade(film, _video_frame.get());
+ _inter_size = content->video->scale().size(content->video, video_container_size, film_frame_size);
+ _out_size = video_container_size;
+ _colour_conversion = content->video->colour_conversion();
+ _video_range = content->video->range();