[vlc-commits] input: delete stream from demux_Delete() (refs #8455)
Rémi Denis-Courmont
git at videolan.org
Tue Aug 27 21:40:43 CEST 2013
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Aug 27 22:20:12 2013 +0300| [c23258ff2418ca7e670d50771d158e6258439b6f] | committer: Rémi Denis-Courmont
input: delete stream from demux_Delete() (refs #8455)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c23258ff2418ca7e670d50771d158e6258439b6f
---
src/input/demux.c | 6 +++++-
src/input/input.c | 7 +------
src/input/stream_demux.c | 3 +++
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/input/demux.c b/src/input/demux.c
index 526a56c..5730e47 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -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 )
{
- 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_location );
free( p_demux->psz_demux );
free( p_demux->psz_access );
+ s = p_demux->s;
vlc_object_release( p_demux );
+ if( s != NULL )
+ stream_Delete( s );
}
/*****************************************************************************
diff --git a/src/input/input.c b/src/input/input.c
index bb86d91..b87ab7e 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2426,6 +2426,7 @@ static int InputSourceInit( input_thread_t *p_input,
if( in->p_demux == NULL )
{
+ stream_Delete( in->p_stream );
if( vlc_object_alive( p_input ) )
{
msg_Err( p_input, "no suitable demux module for `%s/%s://%s'",
@@ -2513,9 +2514,6 @@ error:
if( in->p_demux )
demux_Delete( in->p_demux );
- if( in->p_stream )
- stream_Delete( in->p_stream );
-
free( psz_var_demux );
free( psz_dup );
@@ -2532,9 +2530,6 @@ static void InputSourceClean( input_source_t *in )
if( in->p_demux )
demux_Delete( in->p_demux );
- if( in->p_stream )
- stream_Delete( in->p_stream );
-
if( in->i_title > 0 )
{
for( i = 0; i < in->i_title; i++ )
diff --git a/src/input/stream_demux.c b/src/input/stream_demux.c
index ad3e973..3280021 100644
--- a/src/input/stream_demux.c
+++ b/src/input/stream_demux.c
@@ -363,6 +363,9 @@ static void* DStreamThread( void *obj )
break;
}
+ /* Explicit kludge: the stream is destroyed by the owner of the
+ * streamDemux, not here. */
+ p_demux->s = NULL;
demux_Delete( p_demux );
return NULL;
More information about the vlc-commits
mailing list