]> git.sesse.net Git - vlc/commitdiff
* modules/stream_out/transcode.c: fixed a segfault when quitting.
authorChristophe Massiot <massiot@videolan.org>
Fri, 20 Feb 2004 19:03:59 +0000 (19:03 +0000)
committerChristophe Massiot <massiot@videolan.org>
Fri, 20 Feb 2004 19:03:59 +0000 (19:03 +0000)
modules/stream_out/transcode.c

index 858c1b4a7d66af3ea6508005758c70c03be6ce3c..61e7eb0b6df610f02b68dfe5445c031d32fe2c03 100644 (file)
@@ -2,7 +2,7 @@
  * transcode.c: transcoding stream output module
  *****************************************************************************
  * Copyright (C) 2003-2004 VideoLAN
- * $Id: transcode.c,v 1.76 2004/02/20 18:34:28 massiot Exp $
+ * $Id: transcode.c,v 1.77 2004/02/20 19:03:59 massiot Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -1205,6 +1205,14 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
 static void transcode_video_ffmpeg_close ( sout_stream_t *p_stream,
                                            sout_stream_id_t *id )
 {
+    if ( p_stream->p_sys->i_threads >= 1 )
+    {
+       p_stream->p_sys->b_die = 1;
+       vlc_thread_join( p_stream->p_sys );
+       vlc_mutex_destroy( &p_stream->p_sys->lock_out );
+       vlc_cond_destroy( &p_stream->p_sys->cond );
+    }
+
     /* Close decoder */
     if( id->ff_dec )
     {
@@ -1242,13 +1250,6 @@ static void transcode_video_ffmpeg_close ( sout_stream_t *p_stream,
     {
         img_resample_close( id->p_vresample );
     }
-    if ( p_stream->p_sys->i_threads >= 1 )
-    {
-       p_stream->p_sys->b_die = 1;
-       vlc_thread_join( p_stream->p_sys );
-       vlc_mutex_destroy( &p_stream->p_sys->lock_out );
-       vlc_cond_destroy( &p_stream->p_sys->cond );
-    }
 }
 
 static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,