From cc116115681a9c484ee23592ef16d724f843ae70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 21 Mar 2015 17:58:27 +0200 Subject: [PATCH] es_out: do not start buffering when already buferring This fixes an assertion failure. Regression from 621400186a49b282197267e588a030b425829a64. --- src/input/decoder.c | 2 -- src/input/es_out.c | 17 ++++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/input/decoder.c b/src/input/decoder.c index 8cb162c4d3..062a111b65 100644 --- a/src/input/decoder.c +++ b/src/input/decoder.c @@ -533,8 +533,6 @@ void input_DecoderStartWait( decoder_t *p_dec ) assert( !p_owner->b_waiting ); - input_DecoderFlush( p_dec ); - vlc_mutex_lock( &p_owner->lock ); p_owner->b_first = true; p_owner->b_has_data = false; diff --git a/src/input/es_out.c b/src/input/es_out.c index 14464769e7..b2326435e9 100644 --- a/src/input/es_out.c +++ b/src/input/es_out.c @@ -573,13 +573,16 @@ static void EsOutChangePosition( es_out_t *out ) { es_out_id_t *p_es = p_sys->es[i]; - if( !p_es->p_dec ) - continue; - - input_DecoderStartWait( p_es->p_dec ); - - if( p_es->p_dec_record ) - input_DecoderStartWait( p_es->p_dec_record ); + if( p_es->p_dec != NULL ) + { + input_DecoderFlush( p_es->p_dec ); + if( !p_sys->b_buffering ) + { + input_DecoderStartWait( p_es->p_dec ); + if( p_es->p_dec_record != NULL ) + input_DecoderStartWait( p_es->p_dec_record ); + } + } } for( int i = 0; i < p_sys->i_pgrm; i++ ) -- 2.39.2