]> git.sesse.net Git - vlc/commitdiff
. Added a missing mutex_unlock in video_output.c
authorSam Hocevar <sam@videolan.org>
Mon, 8 Jan 2001 18:16:33 +0000 (18:16 +0000)
committerSam Hocevar <sam@videolan.org>
Mon, 8 Jan 2001 18:16:33 +0000 (18:16 +0000)
 . Moved a mutex_destroy after the thread cancellation to prevent
   possible problems
 . Added a missing #ifdef in intf_msg.c which prevented compilation
   with --enable-debug
 . Fixed a bug in the input that prevented to quit properly in certain
   cases (some ES were not deleted because their index was skipped when
   the former one was deleted, well Meuuh should know what I mean)

  There is still a segfault when quitting, most presumably in the
 audio output. I couldn't find what causes it yet.

src/input/input_programs.c
src/input/mpeg_system.c
src/interface/interface.c
src/interface/intf_msg.c
src/video_output/video_output.c

index 907354148ae4e3f795290068bfd82af41823cb28..7a477aab39270191535194faacfed245c97f4e25 100644 (file)
@@ -2,7 +2,7 @@
  * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_programs.c,v 1.21 2001/01/07 16:17:58 sam Exp $
+ * $Id: input_programs.c,v 1.22 2001/01/08 18:16:33 sam Exp $
  *
  * Authors:
  *
@@ -88,6 +88,7 @@ void input_EndStream( input_thread_t * p_input )
     /* Free standalone ES */
     for( i = 0; i < p_input->stream.i_es_number; i++ )
     {
+        /* Don't put i instead of 0 !! */
         input_DelES( p_input, p_input->stream.pp_es[0] );
     }
 }
@@ -196,7 +197,8 @@ void input_DelProgram( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm )
     /* Free the structures that describe the es that belongs to that program */
     for( i_index = 0; i_index < p_pgrm->i_es_number; i_index++ )
     {
-        input_DelES( p_input, p_pgrm->pp_es[i_index] );
+        /* Don't put i_index instead of 0 !! */
+        input_DelES( p_input, p_pgrm->pp_es[0] );
     }
 
     /* Free the demux data */
index 99906b00b269c49a3274e5606517cc7850959309..4b280201e120fce5e21ccc583a1d71c38c7ac0d4 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_system.c: TS, PS and PES management
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: mpeg_system.c,v 1.24 2001/01/05 18:46:44 massiot Exp $
+ * $Id: mpeg_system.c,v 1.25 2001/01/08 18:16:33 sam Exp $
  *
  * Authors: 
  *
@@ -818,9 +818,10 @@ static void DecodePSM( input_thread_t * p_input, data_packet_t * p_data )
          i < p_input->stream.pp_programs[0]->i_es_number;
          i++ )
     {
+        /* We remove pp_es[i_new_es_member] and not pp_es[i] because the
+         * list will be emptied starting from the end */
         input_DelES( p_input,
                      p_input->stream.pp_programs[0]->pp_es[i_new_es_number] );
-        /* Yes, I wrote *i_new_es_number* */
     }
 
 #ifdef STATS
index d5ac71e59d3fcf9ce022a2e68a357ccc6f2171f5..7e08aa0e2eceab19be94f8595387413ffbbbec9f 100644 (file)
@@ -283,8 +283,7 @@ void intf_Destroy( intf_thread_t *p_intf )
         p_cur = p_next;
     }
          
-        
-        /* Free structure */
+    /* Free structure */
     free( p_intf );
 }
 
index b6b0e449c93c911a83ff356b48a9a1ca8d8b7aa7..9a8d709012254beff498537df9af2f8d6a2ed3d0 100644 (file)
@@ -175,8 +175,10 @@ void intf_MsgDestroy( void )
     }
 #endif
 
+#ifdef INTF_MSG_QUEUE
     /* destroy lock */
     vlc_mutex_destroy( &p_main->p_msg->lock );
+#endif
     
     /* Free structure */
     free( p_main->p_msg );
index 10f1c756a88a49c92e63e7a2a3ab142d4e9b95c2..ceaf93097c452897c89bbc2da71e613174bca1e5 100644 (file)
@@ -1275,8 +1275,8 @@ static void EndThread( vout_thread_t *p_vout )
         struct tms cpu_usage;
         times( &cpu_usage );
 
-        intf_Msg("vout stats: cpu usage (user: %d, system: %d)",
-                 cpu_usage.tms_utime, cpu_usage.tms_stime);
+        intf_Msg( "vout stats: cpu usage (user: %d, system: %d)",
+                  cpu_usage.tms_utime, cpu_usage.tms_stime );
     }
 #endif
 
@@ -1288,6 +1288,7 @@ static void EndThread( vout_thread_t *p_vout )
             free( p_vout->p_picture[i_index].p_data );
         }
     }
+
     for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++ )
     {
         if( p_vout->p_subpicture[i_index].i_status != FREE_SUBPICTURE )
@@ -1299,6 +1300,9 @@ static void EndThread( vout_thread_t *p_vout )
     /* Destroy translation tables */
     vout_EndYUV( p_vout );
     p_vout->p_sys_end( p_vout );
+
+    /* Release the change lock */
+    vlc_mutex_unlock( &p_vout->change_lock );
 }
 
 /*****************************************************************************