Properly attach stream_Demux object to its parent.
authorMarian Ďurkovič <md@bts.sk>
Mon, 7 Sep 2009 05:47:34 +0000 (07:47 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 7 Sep 2009 19:29:09 +0000 (22:29 +0300)
Now :demuxdump-file=foo works correctly with RTP input.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
src/input/stream_demux.c

index 777091c..f402051 100644 (file)
@@ -93,9 +93,12 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
         return NULL;
     }
 
+    vlc_object_attach( s, p_obj );
+
     if( vlc_thread_create( s, "stream out", DStreamThread,
                            VLC_THREAD_PRIORITY_INPUT ) )
     {
+        vlc_object_detach( s );
         stream_CommonDelete( s );
         free( p_sys->psz_name );
         free( p_sys );
@@ -132,7 +135,7 @@ static void DStreamDelete( stream_t *s )
     block_FifoRelease( p_sys->p_fifo );
     free( p_sys->psz_name );
     free( p_sys );
-
+    vlc_object_detach( s );
     stream_CommonDelete( s );
 }