Commit 0f44a068 authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Rafaël Carré

sout: report muxer errors back

parent f04a7c62
...@@ -157,7 +157,7 @@ VLC_API sout_mux_t * sout_MuxNew( sout_instance_t*, const char *, sout_access_ou ...@@ -157,7 +157,7 @@ VLC_API sout_mux_t * sout_MuxNew( sout_instance_t*, const char *, sout_access_ou
VLC_API sout_input_t * sout_MuxAddStream( sout_mux_t *, es_format_t * ) VLC_USED; VLC_API sout_input_t * sout_MuxAddStream( sout_mux_t *, es_format_t * ) VLC_USED;
VLC_API void sout_MuxDeleteStream( sout_mux_t *, sout_input_t * ); VLC_API void sout_MuxDeleteStream( sout_mux_t *, sout_input_t * );
VLC_API void sout_MuxDelete( sout_mux_t * ); VLC_API void sout_MuxDelete( sout_mux_t * );
VLC_API void sout_MuxSendBuffer( sout_mux_t *, sout_input_t *, block_t * ); VLC_API int sout_MuxSendBuffer( sout_mux_t *, sout_input_t *, block_t * );
VLC_API int sout_MuxGetStream(sout_mux_t *, int , mtime_t *); VLC_API int sout_MuxGetStream(sout_mux_t *, int , mtime_t *);
static inline int sout_MuxControl( sout_mux_t *p_mux, int i_query, ... ) static inline int sout_MuxControl( sout_mux_t *p_mux, int i_query, ... )
......
...@@ -427,8 +427,6 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id, ...@@ -427,8 +427,6 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer ) block_t *p_buffer )
{ {
VLC_UNUSED(p_stream); VLC_UNUSED(p_stream);
sout_MuxSendBuffer( id->p_mux, id->p_input, p_buffer ); return sout_MuxSendBuffer( id->p_mux, id->p_input, p_buffer );
return VLC_SUCCESS;
} }
...@@ -1697,8 +1697,7 @@ static int MuxSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id, ...@@ -1697,8 +1697,7 @@ static int MuxSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
sout_mux_t *p_mux = p_stream->p_sys->p_mux; sout_mux_t *p_mux = p_stream->p_sys->p_mux;
assert( p_mux != NULL ); assert( p_mux != NULL );
sout_MuxSendBuffer( p_mux, (sout_input_t *)id, p_buffer ); return sout_MuxSendBuffer( p_mux, (sout_input_t *)id, p_buffer );
return VLC_SUCCESS;
} }
......
...@@ -146,8 +146,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id ) ...@@ -146,8 +146,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id, static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer ) block_t *p_buffer )
{ {
sout_MuxSendBuffer( p_stream->p_sys->p_mux, (sout_input_t*)id, p_buffer ); return sout_MuxSendBuffer( p_stream->p_sys->p_mux, (sout_input_t*)id, p_buffer );
return VLC_SUCCESS;
} }
static void create_SDP(sout_stream_t *p_stream, sout_access_out_t *p_access) static void create_SDP(sout_stream_t *p_stream, sout_access_out_t *p_access)
{ {
......
...@@ -657,7 +657,11 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id, ...@@ -657,7 +657,11 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
switch( id->p_decoder->fmt_in.i_cat ) switch( id->p_decoder->fmt_in.i_cat )
{ {
case AUDIO_ES: case AUDIO_ES:
transcode_audio_process( p_stream, id, p_buffer, &p_out ); if( transcode_audio_process( p_stream, id, p_buffer, &p_out )
!= VLC_SUCCESS )
{
return VLC_EGENERIC;
}
break; break;
case VIDEO_ES: case VIDEO_ES:
......
...@@ -1467,7 +1467,7 @@ static void DecoderPlaySpu( decoder_t *p_dec, subpicture_t *p_subpic ) ...@@ -1467,7 +1467,7 @@ static void DecoderPlaySpu( decoder_t *p_dec, subpicture_t *p_subpic )
} }
#ifdef ENABLE_SOUT #ifdef ENABLE_SOUT
static void DecoderPlaySout( decoder_t *p_dec, block_t *p_sout_block ) static int DecoderPlaySout( decoder_t *p_dec, block_t *p_sout_block )
{ {
decoder_owner_sys_t *p_owner = p_dec->p_owner; decoder_owner_sys_t *p_owner = p_dec->p_owner;
...@@ -1490,9 +1490,15 @@ static void DecoderPlaySout( decoder_t *p_dec, block_t *p_sout_block ) ...@@ -1490,9 +1490,15 @@ static void DecoderPlaySout( decoder_t *p_dec, block_t *p_sout_block )
vlc_mutex_unlock( &p_owner->lock ); vlc_mutex_unlock( &p_owner->lock );
if( !b_reject ) if( !b_reject )
sout_InputSendBuffer( p_owner->p_sout_input, p_sout_block ); // FIXME --VLC_TS_INVALID inspect stream_output/* {
/* FIXME --VLC_TS_INVALID inspect stream_output*/
return sout_InputSendBuffer( p_owner->p_sout_input, p_sout_block );
}
else else
{
block_Release( p_sout_block ); block_Release( p_sout_block );
return VLC_EGENERIC;
}
} }
#endif #endif
...@@ -1541,7 +1547,16 @@ static void DecoderProcessSout( decoder_t *p_dec, block_t *p_block ) ...@@ -1541,7 +1547,16 @@ static void DecoderProcessSout( decoder_t *p_dec, block_t *p_block )
p_sout_block->p_next = NULL; p_sout_block->p_next = NULL;
DecoderPlaySout( p_dec, p_sout_block ); if( DecoderPlaySout( p_dec, p_sout_block ) == VLC_EGENERIC )
{
msg_Err( p_dec, "cannot continue streaming due to errors" );
p_dec->b_error = true;
/* Cleanup */
block_ChainRelease( p_next );
return;
}
p_sout_block = p_next; p_sout_block = p_next;
} }
......
...@@ -287,7 +287,7 @@ sout_mux_t *sout_MuxNew (sout_instance_t *instance, const char *mux, ...@@ -287,7 +287,7 @@ sout_mux_t *sout_MuxNew (sout_instance_t *instance, const char *mux,
assert (0); assert (0);
} }
void sout_MuxSendBuffer (sout_mux_t *mux, sout_input_t *input, block_t *block) int sout_MuxSendBuffer (sout_mux_t *mux, sout_input_t *input, block_t *block)
{ {
assert (0); assert (0);
} }
......
...@@ -512,7 +512,7 @@ void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -512,7 +512,7 @@ void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input )
/***************************************************************************** /*****************************************************************************
* sout_MuxSendBuffer: * sout_MuxSendBuffer:
*****************************************************************************/ *****************************************************************************/
void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input, int sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
block_t *p_buffer ) block_t *p_buffer )
{ {
block_FifoPut( p_input->p_fifo, p_buffer ); block_FifoPut( p_input->p_fifo, p_buffer );
...@@ -535,10 +535,10 @@ void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input, ...@@ -535,10 +535,10 @@ void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
/* Wait until we have enought data before muxing */ /* Wait until we have enought data before muxing */
if( p_mux->i_add_stream_start < 0 || if( p_mux->i_add_stream_start < 0 ||
p_buffer->i_dts < p_mux->i_add_stream_start + i_caching ) p_buffer->i_dts < p_mux->i_add_stream_start + i_caching )
return; return VLC_SUCCESS;
p_mux->b_waiting_stream = false; p_mux->b_waiting_stream = false;
} }
p_mux->pf_mux( p_mux ); return p_mux->pf_mux( p_mux );
} }
......
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