diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-11-19 22:39:38 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-11-19 22:39:38 +0100 |
| commit | 4cb18d1e0b8fdedf6bb38e1d4187a2d782957022 (patch) | |
| tree | fff04fbe4c14161f7ddcd336f28d91f5cf20fc69 /src/lib | |
| parent | bcb962515b31ac6a40a3393c6d4e07b28cedc62b (diff) | |
Fix problems with playing back 3D DCPs and with inserting 3D DCPs
in 2D projects. Also add some tests.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_encoder.cc | 11 | ||||
| -rw-r--r-- | src/lib/video_decoder.cc | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/dcp_encoder.cc b/src/lib/dcp_encoder.cc index 448fc2a52..d17c6c985 100644 --- a/src/lib/dcp_encoder.cc +++ b/src/lib/dcp_encoder.cc @@ -126,9 +126,14 @@ DCPEncoder::go () void DCPEncoder::video (shared_ptr<PlayerVideo> data, DCPTime time) { - if (!_film->three_d() && data->eyes() == EYES_LEFT) { - /* Use left-eye images for both eyes */ - data->set_eyes (EYES_BOTH); + if (!_film->three_d()) { + if (data->eyes() == EYES_LEFT) { + /* Use left-eye images for both eyes... */ + data->set_eyes (EYES_BOTH); + } else if (data->eyes() == EYES_RIGHT) { + /* ...and discard the right */ + return; + } } _j2k_encoder->encode (data, time); diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 19a994197..9c80cd5c4 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -80,7 +80,8 @@ VideoDecoder::emit (shared_ptr<const Film> film, shared_ptr<const ImageProxy> im frame = decoder_frame; } } else { - if (_content->video->frame_type() == VIDEO_FRAME_TYPE_3D_ALTERNATE) { + VideoFrameType const ft = _content->video->frame_type (); + if (ft == VIDEO_FRAME_TYPE_3D_ALTERNATE || ft == VIDEO_FRAME_TYPE_3D) { DCPOMATIC_ASSERT (_last_emitted_eyes); if (_last_emitted_eyes.get() == EYES_RIGHT) { frame = _position->frames_round(afr) + 1; |
