Try a different approach to frame duplication in the decoder.
[dcpomatic.git] / src / lib / decoder.cc
index abb4d13a1ec404daccdb0f7ef21f6bf94a70234e..e154aac5d10b3f3fd2d3b878798eb776a7337afc 100644 (file)
@@ -310,11 +310,21 @@ Decoder::process_video (AVFrame* frame)
                }
                
                TIMING ("Decoder emits %1", _video_frame_index);
-               Video ((*i), _video_frame_index, sub);
+               Video (*i, _video_frame_index, sub);
                ++_video_frame_index;
+               _last_image = *i;
+               _last_subtitle = sub;
        }
 }
 
+void
+Decoder::repeat_last_video ()
+{
+       assert (_last_image);
+       Video (_last_image, _video_frame_index, _last_subtitle);
+       ++_video_frame_index;
+}
+
 void
 Decoder::process_subtitle (shared_ptr<TimedSubtitle> s)
 {