]> git.sesse.net Git - vlc/blobdiff - src/input/stream_demux.c
htcpcp: handle 418 I'm a teapot
[vlc] / src / input / stream_demux.c
index e81537189caf7260ce73ab8b042486b5b2d7d38e..3d57d853c599ff3c63bb4fd9d07f66b3d8ecd0d5 100644 (file)
@@ -96,10 +96,8 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
 
     vlc_object_attach( s, p_obj );
 
-    if( vlc_thread_create( s, "stream out", DStreamThread,
-                           VLC_THREAD_PRIORITY_INPUT ) )
+    if( vlc_thread_create( s, DStreamThread, VLC_THREAD_PRIORITY_INPUT ) )
     {
-        vlc_object_detach( s );
         stream_CommonDelete( s );
         free( p_sys->psz_name );
         free( p_sys );
@@ -112,8 +110,7 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
 void stream_DemuxSend( stream_t *s, block_t *p_block )
 {
     stream_sys_t *p_sys = s->p_sys;
-    if( p_block )
-        block_FifoPut( p_sys->p_fifo, p_block );
+    block_FifoPut( p_sys->p_fifo, p_block );
 }
 
 static void DStreamDelete( stream_t *s )
@@ -122,6 +119,7 @@ static void DStreamDelete( stream_t *s )
     block_t *p_empty;
 
     vlc_object_kill( s );
+#warning FIXME: not thread-safe:
     if( p_sys->p_demux )
         vlc_object_kill( p_sys->p_demux );
     p_empty = block_New( s, 1 ); p_empty->i_buffer = 0;
@@ -136,7 +134,6 @@ 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 );
 }
 
@@ -306,4 +303,3 @@ static void* DStreamThread( vlc_object_t* p_this )
     vlc_object_kill( p_demux );
     return NULL;
 }
-