Better errors if butler doesn't give video during export.
authorCarl Hetherington <cth@carlh.net>
Sun, 16 Feb 2020 20:15:12 +0000 (21:15 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 16 Feb 2020 20:15:12 +0000 (21:15 +0100)
src/lib/ffmpeg_encoder.cc

index 6b31185..61e489f 100644 (file)
@@ -152,7 +152,11 @@ FFmpegEncoder::go ()
                }
 
                for (int j = 0; j < gets_per_frame; ++j) {
-                       pair<shared_ptr<PlayerVideo>, DCPTime> v = _butler->get_video (true, 0);
+                       Butler::Error e;
+                       pair<shared_ptr<PlayerVideo>, DCPTime> v = _butler->get_video (true, &e);
+                       if (!v.first) {
+                               throw ProgrammingError(__FILE__, __LINE__, String::compose("butler returned no video; error was %1", static_cast<int>(e)));
+                       }
                        shared_ptr<FFmpegFileEncoder> fe = encoder->get (v.first->eyes());
                        if (fe) {
                                fe->video(v.first, v.second);