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_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 *);
static inline int sout_MuxControl( sout_mux_t *p_mux, int i_query, ... )
block_t *p_buffer )
{
VLC_UNUSED(p_stream);
- sout_MuxSendBuffer( id->p_mux, id->p_input, p_buffer );
-
- return VLC_SUCCESS;
+ return sout_MuxSendBuffer( id->p_mux, id->p_input, p_buffer );
}
sout_mux_t *p_mux = p_stream->p_sys->p_mux;
assert( p_mux != NULL );
- sout_MuxSendBuffer( p_mux, (sout_input_t *)id, p_buffer );
- return VLC_SUCCESS;
+ return sout_MuxSendBuffer( p_mux, (sout_input_t *)id, p_buffer );
}
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
{
- sout_MuxSendBuffer( p_stream->p_sys->p_mux, (sout_input_t*)id, p_buffer );
- return VLC_SUCCESS;
+ return sout_MuxSendBuffer( p_stream->p_sys->p_mux, (sout_input_t*)id, p_buffer );
}
static void create_SDP(sout_stream_t *p_stream, sout_access_out_t *p_access)
{
switch( id->p_decoder->fmt_in.i_cat )
{
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;
case VIDEO_ES:
}
#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;
vlc_mutex_unlock( &p_owner->lock );
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
+ {
block_Release( p_sout_block );
+ return VLC_EGENERIC;
+ }
}
#endif
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;
}
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);
}
/*****************************************************************************
* 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_FifoPut( p_input->p_fifo, p_buffer );
/* Wait until we have enought data before muxing */
if( p_mux->i_add_stream_start < 0 ||
p_buffer->i_dts < p_mux->i_add_stream_start + i_caching )
- return;
+ return VLC_SUCCESS;
p_mux->b_waiting_stream = false;
}
- p_mux->pf_mux( p_mux );
+ return p_mux->pf_mux( p_mux );
}