Commit 29bc5aa2 authored by Steve Lhomme's avatar Steve Lhomme
Browse files

mosaic_bridge: fully drain the video filter when the input source changes

parent 688be5d2
...@@ -622,12 +622,30 @@ static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer ) ...@@ -622,12 +622,30 @@ static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
return ret == VLCDEC_SUCCESS ? VLC_SUCCESS : VLC_EGENERIC; return ret == VLCDEC_SUCCESS ? VLC_SUCCESS : VLC_EGENERIC;
} }
static void drain_filter(sout_stream_sys_t *p_sys)
{
bridged_es_t *p_es = p_sys->p_es;
picture_t * p_in = NULL;
do
{
p_in = filter_chain_VideoDrain( p_sys->p_vf2, true );
if( p_in )
{
vlc_global_lock( VLC_MOSAIC_MUTEX );
vlc_picture_chain_Append( &p_es->pictures, p_in );
vlc_global_unlock( VLC_MOSAIC_MUTEX );
}
} while (p_in != NULL);
}
static int video_update_format_decoder( decoder_t *p_dec, vlc_video_context *vctx ) static int video_update_format_decoder( decoder_t *p_dec, vlc_video_context *vctx )
{ {
struct decoder_owner *p_owner = dec_get_owner( p_dec ); struct decoder_owner *p_owner = dec_get_owner( p_dec );
sout_stream_sys_t *p_sys = p_owner->p_stream->p_sys; sout_stream_sys_t *p_sys = p_owner->p_stream->p_sys;
if ( p_sys->p_vf2 ) if ( p_sys->p_vf2 )
{ {
drain_filter( p_sys );
// update the filter after the format changed/is known // update the filter after the format changed/is known
char *psz_chain = var_GetNonEmptyString( p_owner->p_stream, CFG_PREFIX "vfilter" ); char *psz_chain = var_GetNonEmptyString( p_owner->p_stream, CFG_PREFIX "vfilter" );
msg_Dbg( p_owner->p_stream, "update filter: '%s'", msg_Dbg( p_owner->p_stream, "update filter: '%s'",
......
Supports Markdown
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