Commit c23258ff authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: delete stream from demux_Delete() (refs #8455)

parent 33779198
...@@ -213,14 +213,18 @@ demux_t *demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input, ...@@ -213,14 +213,18 @@ demux_t *demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
*****************************************************************************/ *****************************************************************************/
void demux_Delete( demux_t *p_demux ) void demux_Delete( demux_t *p_demux )
{ {
module_unneed( p_demux, p_demux->p_module ); stream_t *s;
module_unneed( p_demux, p_demux->p_module );
free( p_demux->psz_file ); free( p_demux->psz_file );
free( p_demux->psz_location ); free( p_demux->psz_location );
free( p_demux->psz_demux ); free( p_demux->psz_demux );
free( p_demux->psz_access ); free( p_demux->psz_access );
s = p_demux->s;
vlc_object_release( p_demux ); vlc_object_release( p_demux );
if( s != NULL )
stream_Delete( s );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -2426,6 +2426,7 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2426,6 +2426,7 @@ static int InputSourceInit( input_thread_t *p_input,
if( in->p_demux == NULL ) if( in->p_demux == NULL )
{ {
stream_Delete( in->p_stream );
if( vlc_object_alive( p_input ) ) if( vlc_object_alive( p_input ) )
{ {
msg_Err( p_input, "no suitable demux module for `%s/%s://%s'", msg_Err( p_input, "no suitable demux module for `%s/%s://%s'",
...@@ -2513,9 +2514,6 @@ error: ...@@ -2513,9 +2514,6 @@ error:
if( in->p_demux ) if( in->p_demux )
demux_Delete( in->p_demux ); demux_Delete( in->p_demux );
if( in->p_stream )
stream_Delete( in->p_stream );
free( psz_var_demux ); free( psz_var_demux );
free( psz_dup ); free( psz_dup );
...@@ -2532,9 +2530,6 @@ static void InputSourceClean( input_source_t *in ) ...@@ -2532,9 +2530,6 @@ static void InputSourceClean( input_source_t *in )
if( in->p_demux ) if( in->p_demux )
demux_Delete( in->p_demux ); demux_Delete( in->p_demux );
if( in->p_stream )
stream_Delete( in->p_stream );
if( in->i_title > 0 ) if( in->i_title > 0 )
{ {
for( i = 0; i < in->i_title; i++ ) for( i = 0; i < in->i_title; i++ )
......
...@@ -363,6 +363,9 @@ static void* DStreamThread( void *obj ) ...@@ -363,6 +363,9 @@ static void* DStreamThread( void *obj )
break; break;
} }
/* Explicit kludge: the stream is destroyed by the owner of the
* streamDemux, not here. */
p_demux->s = NULL;
demux_Delete( p_demux ); demux_Delete( p_demux );
return NULL; return NULL;
......
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