Don't fail if we need to insert stuff right at the beginning of the decode.
authorCarl Hetherington <cth@carlh.net>
Thu, 1 Nov 2012 12:12:28 +0000 (12:12 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 1 Nov 2012 12:12:28 +0000 (12:12 +0000)
src/lib/decoder.cc

index e154aac5d10b3f3fd2d3b878798eb776a7337afc..6f5d63358641d803a73ea31021d846ebe4c5a4c4 100644 (file)
@@ -320,7 +320,11 @@ Decoder::process_video (AVFrame* frame)
 void
 Decoder::repeat_last_video ()
 {
-       assert (_last_image);
+       if (!_last_image) {
+               _last_image.reset (new CompactImage (pixel_format(), native_size()));
+               _last_image->make_black ();
+       }
+       
        Video (_last_image, _video_frame_index, _last_subtitle);
        ++_video_frame_index;
 }