]> git.sesse.net Git - x264/commitdiff
Fix crash if encoder_close is called before delayed frames are flushed
authorSteven Walters <kemuri9@gmail.com>
Wed, 9 Sep 2009 19:19:40 +0000 (12:19 -0700)
committerFiona Glaser <fiona@x264.com>
Wed, 9 Sep 2009 19:19:40 +0000 (12:19 -0700)
Also no longer flush frames when ctrl-Cing x264, so x264 will close faster.

encoder/lookahead.c
x264.c

index 35ed729d739dbf7a4aa3daf97decfdd424f7f0e9..0f6474108693b6ab137817a19e3f69a18108d271 100644 (file)
@@ -176,7 +176,7 @@ void x264_lookahead_delete( x264_t *h )
     x264_synch_frame_list_delete( &h->lookahead->next );
     x264_synch_frame_list_delete( &h->lookahead->ofbuf );
     if( h->lookahead->last_nonb )
-        x264_frame_delete( h->lookahead->last_nonb );
+        x264_frame_push_unused( h, h->lookahead->last_nonb );
     x264_free( h->lookahead );
 }
 
diff --git a/x264.c b/x264.c
index 08095d599ae48250f2c7ecdba25380bc8f4ce1df..0fdde7d8722d486d021418279a7916466f9b77e8 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -1227,7 +1227,7 @@ static int  Encode( x264_param_t *param, cli_opt_t *opt )
         }
     }
     /* Flush delayed frames */
-    while( x264_encoder_delayed_frames( h ) )
+    while( !b_ctrl_c && x264_encoder_delayed_frames( h ) )
     {
         i_frame_size = Encode_frame( h, opt->hout, NULL );
         if( i_frame_size < 0 )