Commit 3ce24ee9 authored by Sam Hocevar's avatar Sam Hocevar

 . Added a missing mutex_unlock in video_output.c
 . 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.
parent 618b891b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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: * Authors:
* *
...@@ -88,6 +88,7 @@ void input_EndStream( input_thread_t * p_input ) ...@@ -88,6 +88,7 @@ void input_EndStream( input_thread_t * p_input )
/* Free standalone ES */ /* Free standalone ES */
for( i = 0; i < p_input->stream.i_es_number; i++ ) 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] ); 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 ) ...@@ -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 */ /* 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++ ) 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 */ /* Free the demux data */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management * mpeg_system.c: TS, PS and PES management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * 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: * Authors:
* *
...@@ -818,9 +818,10 @@ static void DecodePSM( input_thread_t * p_input, data_packet_t * p_data ) ...@@ -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 < p_input->stream.pp_programs[0]->i_es_number;
i++ ) 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, input_DelES( p_input,
p_input->stream.pp_programs[0]->pp_es[i_new_es_number] ); p_input->stream.pp_programs[0]->pp_es[i_new_es_number] );
/* Yes, I wrote *i_new_es_number* */
} }
#ifdef STATS #ifdef STATS
......
...@@ -283,7 +283,6 @@ void intf_Destroy( intf_thread_t *p_intf ) ...@@ -283,7 +283,6 @@ void intf_Destroy( intf_thread_t *p_intf )
p_cur = p_next; p_cur = p_next;
} }
/* Free structure */ /* Free structure */
free( p_intf ); free( p_intf );
} }
......
...@@ -175,8 +175,10 @@ void intf_MsgDestroy( void ) ...@@ -175,8 +175,10 @@ void intf_MsgDestroy( void )
} }
#endif #endif
#ifdef INTF_MSG_QUEUE
/* destroy lock */ /* destroy lock */
vlc_mutex_destroy( &p_main->p_msg->lock ); vlc_mutex_destroy( &p_main->p_msg->lock );
#endif
/* Free structure */ /* Free structure */
free( p_main->p_msg ); free( p_main->p_msg );
......
...@@ -1275,8 +1275,8 @@ static void EndThread( vout_thread_t *p_vout ) ...@@ -1275,8 +1275,8 @@ static void EndThread( vout_thread_t *p_vout )
struct tms cpu_usage; struct tms cpu_usage;
times( &cpu_usage ); times( &cpu_usage );
intf_Msg("vout stats: cpu usage (user: %d, system: %d)", intf_Msg( "vout stats: cpu usage (user: %d, system: %d)",
cpu_usage.tms_utime, cpu_usage.tms_stime); cpu_usage.tms_utime, cpu_usage.tms_stime );
} }
#endif #endif
...@@ -1288,6 +1288,7 @@ static void EndThread( vout_thread_t *p_vout ) ...@@ -1288,6 +1288,7 @@ static void EndThread( vout_thread_t *p_vout )
free( p_vout->p_picture[i_index].p_data ); free( p_vout->p_picture[i_index].p_data );
} }
} }
for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++ ) for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++ )
{ {
if( p_vout->p_subpicture[i_index].i_status != FREE_SUBPICTURE ) if( p_vout->p_subpicture[i_index].i_status != FREE_SUBPICTURE )
...@@ -1299,6 +1300,9 @@ static void EndThread( vout_thread_t *p_vout ) ...@@ -1299,6 +1300,9 @@ static void EndThread( vout_thread_t *p_vout )
/* Destroy translation tables */ /* Destroy translation tables */
vout_EndYUV( p_vout ); vout_EndYUV( p_vout );
p_vout->p_sys_end( p_vout ); p_vout->p_sys_end( p_vout );
/* Release the change lock */
vlc_mutex_unlock( &p_vout->change_lock );
} }
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment