Commit 4e82ba21 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

input decoder: clean-up of DecoderProcess

The functionality remains the same, though the code should be easier to
follow and maintain.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0e90f6ee
......@@ -1315,20 +1315,13 @@ static void DecoderProcess( decoder_t *p_dec, block_t *p_block )
decoder_owner_sys_t *p_owner = p_dec->p_owner;
if( p_dec->b_error )
{
if( p_block )
block_Release( p_block );
return;
}
if( p_block && p_block->i_buffer <= 0 )
{
block_Release( p_block );
return;
}
goto error;
if( p_block )
{
if( p_block->i_buffer <= 0 )
goto error;
vlc_mutex_lock( &p_owner->lock );
DecoderUpdatePreroll( &p_owner->i_preroll_end, p_block );
vlc_mutex_unlock( &p_owner->lock );
......@@ -1336,30 +1329,23 @@ static void DecoderProcess( decoder_t *p_dec, block_t *p_block )
#ifdef ENABLE_SOUT
if( p_owner->p_sout != NULL )
{
DecoderProcessSout( p_dec, p_block );
}
else
return DecoderProcessSout( p_dec, p_block );
#endif
switch( p_dec->fmt_out.i_cat )
{
if( p_dec->fmt_out.i_cat == AUDIO_ES )
{
DecoderProcessAudio( p_dec, p_block );
}
else if( p_dec->fmt_out.i_cat == VIDEO_ES )
{
DecoderProcessVideo( p_dec, p_block );
}
else if( p_dec->fmt_out.i_cat == SPU_ES )
{
DecoderProcessSpu( p_dec, p_block );
}
else
{
case VIDEO_ES: return DecoderProcessVideo( p_dec, p_block );
case AUDIO_ES: return DecoderProcessAudio( p_dec, p_block );
case SPU_ES: return DecoderProcessSpu( p_dec, p_block );
default:
msg_Err( p_dec, "unknown ES format" );
p_dec->b_error = true;
}
}
error:
if( p_block )
block_Release( p_block );
}
static void DecoderProcessFlush( decoder_t *p_dec )
......
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