]> granicus.if.org Git - libx264/commitdiff
fix a race condition at the end of thread_input
authorLoren Merritt <pengvado@akuvian.org>
Tue, 19 May 2009 02:47:15 +0000 (02:47 +0000)
committerLoren Merritt <pengvado@akuvian.org>
Tue, 19 May 2009 05:23:26 +0000 (05:23 +0000)
muxers.c

index 2eae1eb3882461a8c557f58f36e29f6ff990802e..d62be5cd8ec7b522bcb5acc5fd62ac0585af7baf 100644 (file)
--- a/muxers.c
+++ b/muxers.c
@@ -505,10 +505,10 @@ int read_frame_thread( x264_picture_t *p_pic, hnd_t handle, int i_frame )
 int close_file_thread( hnd_t handle )
 {
     thread_input_t *h = handle;
-    h->p_close_infile( h->p_handle );
-    x264_picture_clean( &h->pic );
     if( h->in_progress )
         x264_pthread_join( h->tid, NULL );
+    h->p_close_infile( h->p_handle );
+    x264_picture_clean( &h->pic );
     free( h->next_args );
     free( h );
     return 0;