Revert "Use make_shared<>."
[dcpomatic.git] / src / lib / video_decoder.cc
index ec5ae8884b730cfc5f02c40f30e03ff3da2add29..edc746010f082a0558617763798544b750a940d1 100644 (file)
@@ -252,7 +252,7 @@ VideoDecoder::give (shared_ptr<const ImageProxy> image, Frame frame)
                /* We receive the same frame index twice for 3D-alternate; hence we know which
                   frame this one is.
                */
-               bool const same = (!_decoded.empty() && frame == _decoded.back().frame);
+               bool const same = (!_decoded.empty() && frame == _decoded.back().frame.index());
                to_push.push_back (ContentVideo (image, VideoFrame (frame, same ? EYES_RIGHT : EYES_LEFT), PART_WHOLE));
                break;
        }
@@ -282,7 +282,10 @@ VideoDecoder::give (shared_ptr<const ImageProxy> image, Frame frame)
        optional<VideoFrame> from;
 
        if (_decoded.empty() && _last_seek_time && _last_seek_accurate) {
-               from = VideoFrame (_last_seek_time->frames_round (_content->active_video_frame_rate ()), EYES_LEFT);
+               from = VideoFrame (
+                       _last_seek_time->frames_round (_content->active_video_frame_rate ()),
+                       _content->video->frame_type() == VIDEO_FRAME_TYPE_2D ? EYES_BOTH : EYES_LEFT
+                       );
        } else if (!_decoded.empty ()) {
                from = _decoded.back().frame;
                ++(*from);
@@ -292,7 +295,7 @@ VideoDecoder::give (shared_ptr<const ImageProxy> image, Frame frame)
           (frames before the last seek time) which we can just ignore.
        */
 
-       if (from && from->index() > to_push.front().frame.index()) {
+       if (from && (*from) > to_push.front().frame) {
                return;
        }