- /* Text subtitles (rendered to an image) */
- if (_burn_subtitles && !ps.text.empty ()) {
- list<PositionImage> s = render_subtitles (ps.text, _video_container_size);
- copy (s.begin (), s.end (), back_inserter (sub_images));
+ bool const use =
+ /* always use the last video */
+ piece == last ||
+ /* with a corresponding L/R eye if appropriate */
+ (last_type == VIDEO_FRAME_TYPE_3D_LEFT && video_content->video_frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) ||
+ (last_type == VIDEO_FRAME_TYPE_3D_RIGHT && video_content->video_frame_type() == VIDEO_FRAME_TYPE_3D_LEFT);
+
+ if (use) {
+ /* We want to use this piece */
+ list<ContentVideo> content_video = decoder->get_video (dcp_to_content_video (piece, time), accurate);
+ if (content_video.empty ()) {
+ pvf.push_back (black_player_video_frame (time));
+ } else {
+ dcp::Size image_size = video_content->scale().size (video_content, _video_container_size, _film->frame_size ());
+
+ for (list<ContentVideo>::const_iterator i = content_video.begin(); i != content_video.end(); ++i) {
+ pvf.push_back (
+ shared_ptr<PlayerVideo> (
+ new PlayerVideo (
+ i->image,
+ content_video_to_dcp (piece, i->frame),
+ video_content->crop (),
+ video_content->fade (i->frame),
+ image_size,
+ _video_container_size,
+ i->eyes,
+ i->part,
+ video_content->colour_conversion ()
+ )
+ )
+ );
+ }
+ }
+ } else {
+ /* Discard unused video */
+ decoder->get_video (dcp_to_content_video (piece, time), accurate);
+ }
+ }