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

Force the sending threads to wakeup at exit - closes #1292

parent 56ec18e7
...@@ -302,6 +302,8 @@ static void Close( vlc_object_t * p_this ) ...@@ -302,6 +302,8 @@ static void Close( vlc_object_t * p_this )
int i; int i;
vlc_object_kill( p_sys->p_thread ); vlc_object_kill( p_sys->p_thread );
block_FifoWake( p_sys->p_thread->p_fifo );
for( i = 0; i < 10; i++ ) for( i = 0; i < 10; i++ )
{ {
block_t *p_dummy = block_New( p_access, p_sys->i_mtu ); block_t *p_dummy = block_New( p_access, p_sys->i_mtu );
...@@ -485,6 +487,8 @@ static void ThreadWrite( vlc_object_t *p_this ) ...@@ -485,6 +487,8 @@ static void ThreadWrite( vlc_object_t *p_this )
} }
#endif #endif
p_pk = block_FifoGet( p_thread->p_fifo ); p_pk = block_FifoGet( p_thread->p_fifo );
if( p_pk == NULL )
continue; /* forced wake-up */
i_date = p_thread->i_caching + p_pk->i_dts; i_date = p_thread->i_caching + p_pk->i_dts;
if( i_date_last > 0 ) if( i_date_last > 0 )
......
...@@ -1135,6 +1135,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id ) ...@@ -1135,6 +1135,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
sout_stream_sys_t *p_sys = p_stream->p_sys; sout_stream_sys_t *p_sys = p_stream->p_sys;
vlc_object_kill( id ); vlc_object_kill( id );
block_FifoWake( id->p_fifo );
vlc_mutex_lock( &p_sys->lock_es ); vlc_mutex_lock( &p_sys->lock_es );
TAB_REMOVE( p_sys->i_es, p_sys->es, id ); TAB_REMOVE( p_sys->i_es, p_sys->es, id );
...@@ -1311,6 +1312,9 @@ static void ThreadSend( vlc_object_t *p_this ) ...@@ -1311,6 +1312,9 @@ static void ThreadSend( vlc_object_t *p_this )
while( !id->b_die ) while( !id->b_die )
{ {
block_t *out = block_FifoGet( id->p_fifo ); block_t *out = block_FifoGet( id->p_fifo );
if( out == NULL )
continue; /* Forced wakeup */
mtime_t i_date = out->i_dts + i_caching; mtime_t i_date = out->i_dts + i_caching;
ssize_t len = out->i_buffer; ssize_t len = out->i_buffer;
......
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