From: RĂ©mi Denis-Courmont Date: Wed, 18 Mar 2015 22:39:29 +0000 (+0200) Subject: decoder: remove unused parameter X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b3e6be7ebffe374220b846eaba2ddc158f0f9b85;hp=3188896364d878b5f7183e6bea4dd712e10a0531;p=vlc decoder: remove unused parameter DecoderSignalWait() had no observable effects if has_data was false. It could wake up the condition variable, but no thread would wait on that event. --- diff --git a/src/input/decoder.c b/src/input/decoder.c index b14da258fd..7831647ac4 100644 --- a/src/input/decoder.c +++ b/src/input/decoder.c @@ -61,7 +61,7 @@ static void DeleteDecoder( decoder_t * ); static void *DecoderThread( void * ); static void DecoderProcess( decoder_t *, block_t * ); static void DecoderFlush( decoder_t * ); -static void DecoderSignalWait( decoder_t *, bool ); +static void DecoderSignalWait( decoder_t * ); static void DecoderUnsupportedCodec( decoder_t *, vlc_fourcc_t ); @@ -888,8 +888,8 @@ static void *DecoderThread( void *p_data ) p_owner->b_woken = false; vlc_cleanup_run(); - bool end_wait = !p_block || p_block->i_flags & BLOCK_FLAG_CORE_EOS; - DecoderSignalWait( p_dec, end_wait ); + if( p_block == NULL || p_block->i_flags & BLOCK_FLAG_CORE_EOS ) + DecoderSignalWait( p_dec ); if( p_block ) { @@ -950,7 +950,7 @@ static void DecoderFlush( decoder_t *p_dec ) vlc_cond_wait( &p_owner->wait_acknowledge, &p_owner->lock ); } -static void DecoderSignalWait( decoder_t *p_dec, bool b_has_data ) +static void DecoderSignalWait( decoder_t *p_dec ) { decoder_owner_sys_t *p_owner = p_dec->p_owner; @@ -958,8 +958,7 @@ static void DecoderSignalWait( decoder_t *p_dec, bool b_has_data ) if( p_owner->b_waiting ) { - if( b_has_data ) - p_owner->b_has_data = true; + p_owner->b_has_data = true; vlc_cond_signal( &p_owner->wait_acknowledge ); } @@ -2165,7 +2164,7 @@ static picture_t *vout_new_buffer( decoder_t *p_dec ) return NULL; /* */ - DecoderSignalWait( p_dec, true ); + DecoderSignalWait( p_dec ); /* Check the decoder doesn't leak pictures */ vout_FixLeaks( p_owner->p_vout );