Add another translator.
[dcpomatic.git] / src / lib / video_mxf_decoder.cc
index 37ffafa71cd742284f5ef0336cbe763d8f0a30a2..70c884699fe523b81fdbe568adc85402ca22539a 100644 (file)
@@ -35,8 +35,15 @@ VideoMXFDecoder::VideoMXFDecoder (shared_ptr<const VideoMXFContent> content, sha
 }
 
 bool
-VideoMXFDecoder::pass (PassReason reason, bool)
+VideoMXFDecoder::pass (PassReason, bool)
 {
+       double const vfr = _content->active_video_frame_rate ();
+       int64_t const frame = _next.frames_round (vfr);
+
+       if (frame >= _content->video->length()) {
+               return true;
+       }
+
        shared_ptr<dcp::MonoPictureAsset> mono;
        try {
                mono.reset (new dcp::MonoPictureAsset (_content->path(0)));
@@ -59,9 +66,6 @@ VideoMXFDecoder::pass (PassReason reason, bool)
                }
        }
 
-       double const vfr = _content->active_video_frame_rate ();
-       int64_t const frame = _next.frames_round (vfr);
-
        if (mono) {
                video->give (shared_ptr<ImageProxy> (new J2KImageProxy (mono->get_frame(frame), mono->size())), frame);
        } else {
@@ -70,6 +74,7 @@ VideoMXFDecoder::pass (PassReason reason, bool)
        }
 
        _next += ContentTime::from_frames (1, vfr);
+       return false;
 }
 
 void