]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/encoder.c: sanity check for frames in the past that libavcodec...
authorGildas Bazin <gbazin@videolan.org>
Sun, 24 Oct 2004 15:26:23 +0000 (15:26 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 24 Oct 2004 15:26:23 +0000 (15:26 +0000)
modules/codec/ffmpeg/encoder.c

index 9a526ab8a2567203e43d3ff0194b31e82b4b0a0c..b7c57c4ed45333056a14c671265fe4f51a0becd5 100644 (file)
@@ -678,6 +678,13 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
                       "same PTS (" I64Fd ")", frame.pts );
             return NULL;
         }
+        else if ( p_sys->i_last_pts > frame.pts )
+        {
+            msg_Warn( p_enc, "almost fed libavcodec with a frame in the "
+                      "past (current: " I64Fd ", last: "I64Fd")",
+                      frame.pts, p_sys->i_last_pts );
+            return NULL;
+        }
         else
         {
             p_sys->i_last_pts = frame.pts;