Don't try to make decoders when there is no content.
[dcpomatic.git] / src / lib / matcher.cc
index 2dd36c11e79a1d60328eb5d0e828bf1266d5851b..182fb306c695d1008b4b8be8d50732af4cddda55 100644 (file)
@@ -35,9 +35,9 @@ Matcher::Matcher (Log* log, int sample_rate, float frames_per_second)
 }
 
 void
-Matcher::process_video (boost::shared_ptr<Image> i, boost::shared_ptr<Subtitle> s)
+Matcher::process_video (boost::shared_ptr<Image> i, bool same, boost::shared_ptr<Subtitle> s)
 {
-       Video (i, s);
+       Video (i, same, s);
        _video_frames++;
 
        _pixel_format = i->pixel_format ();
@@ -81,10 +81,10 @@ Matcher::process_end ()
                
                _log->log (String::compose ("Emitting %1 frames of black video", black_video_frames));
 
-               shared_ptr<Image> black (new SimpleImage (_pixel_format.get(), _size.get(), false));
+               shared_ptr<Image> black (new SimpleImage (_pixel_format.get(), _size.get(), true));
                black->make_black ();
                for (int i = 0; i < black_video_frames; ++i) {
-                       Video (black, shared_ptr<Subtitle>());
+                       Video (black, i != 0, shared_ptr<Subtitle>());
                }
                
                /* Now recompute our check value */