Fix crash when no video is being encoded.
authorCarl Hetherington <cth@carlh.net>
Mon, 20 Jun 2016 21:41:31 +0000 (22:41 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 20 Jun 2016 21:41:31 +0000 (22:41 +0100)
src/lib/encoder.cc

index fbc5c3561114f58de84da9781606e130d9fd8c73..6a604ab5174f24c71d2dbf88196b2204df81be70 100644 (file)
@@ -166,6 +166,10 @@ Encoder::current_encoding_rate () const
 int
 Encoder::video_frames_enqueued () const
 {
+       if (!_last_player_video) {
+               return 0;
+       }
+
        return _last_player_video->time().frames_floor (_film->video_frame_rate ());
 }