There is nothing special about exiting at this level. The decoder
should discard its buffers and return to reading the input FIFO at the
earliest (where it gets canceled). This is the same as flushing.
vout_thread_t *p_vout;
/* -- Theses variables need locking on read *and* write -- */
vout_thread_t *p_vout;
/* -- Theses variables need locking on read *and* write -- */
/* Pause */
bool b_paused;
struct
/* Pause */
bool b_paused;
struct
p_owner->b_paused = false;
p_owner->b_waiting = false;
p_owner->b_flushing = true;
p_owner->b_paused = false;
p_owner->b_waiting = false;
p_owner->b_flushing = true;
- p_owner->b_exit = true;
vlc_cond_signal( &p_owner->wait_request );
vlc_mutex_unlock( &p_owner->lock );
vlc_cond_signal( &p_owner->wait_request );
vlc_mutex_unlock( &p_owner->lock );
p_owner->b_fmt_description = false;
p_owner->p_description = NULL;
p_owner->b_fmt_description = false;
p_owner->p_description = NULL;
- p_owner->b_exit = false;
-
p_owner->b_paused = false;
p_owner->pause.i_date = VLC_TS_INVALID;
p_owner->pause.i_ignore = 0;
p_owner->b_paused = false;
p_owner->pause.i_date = VLC_TS_INVALID;
p_owner->pause.i_ignore = 0;
-static bool DecoderIsExitRequested( decoder_t *p_dec )
-{
- decoder_owner_sys_t *p_owner = p_dec->p_owner;
-
- vlc_mutex_lock( &p_owner->lock );
- bool b_exit = p_owner->b_exit;
- vlc_mutex_unlock( &p_owner->lock );
-
- return b_exit;
-}
-
/**
* If *pb_reject, it does nothing, otherwise it waits for the given
* deadline or a flush request (in which case it set *pi_reject to true.
/**
* If *pb_reject, it does nothing, otherwise it waits for the given
* deadline or a flush request (in which case it set *pi_reject to true.
- if( p_owner->b_flushing || p_owner->b_exit )
+ if( p_owner->b_flushing )
{
*pb_reject = true;
break;
{
*pb_reject = true;
break;
}
else while( (p_aout_buf = p_dec->pf_decode_audio( p_dec, &p_block )) )
{
}
else while( (p_aout_buf = p_dec->pf_decode_audio( p_dec, &p_block )) )
{
- if( DecoderIsExitRequested( p_dec ) )
+ if( DecoderIsFlushing( p_dec ) )
{
/* It prevent freezing VLC in case of broken decoder */
block_Release( p_aout_buf );
{
/* It prevent freezing VLC in case of broken decoder */
block_Release( p_aout_buf );
while( (p_pic = p_dec->pf_decode_video( p_dec, &p_block )) )
{
vout_thread_t *p_vout = p_owner->p_vout;
while( (p_pic = p_dec->pf_decode_video( p_dec, &p_block )) )
{
vout_thread_t *p_vout = p_owner->p_vout;
- if( DecoderIsExitRequested( p_dec ) )
- {
- /* It prevent freezing VLC in case of broken decoder */
+ if( DecoderIsFlushing( p_dec ) )
+ { /* It prevent freezing VLC in case of broken decoder */
picture_Release( p_pic );
if( p_block )
block_Release( p_block );
picture_Release( p_pic );
if( p_block )
block_Release( p_block );
- if( DecoderIsExitRequested( p_dec ) || p_dec->b_error )
+ if( DecoderIsFlushing( p_dec ) || p_dec->b_error )
return NULL;
picture_t *p_picture = vout_GetPicture( p_owner->p_vout );
if( p_picture )
return p_picture;
return NULL;
picture_t *p_picture = vout_GetPicture( p_owner->p_vout );
if( p_picture )
return p_picture;
- if( DecoderIsFlushing( p_dec ) )
- return NULL;
-
/* */
DecoderSignalWait( p_dec );
/* */
DecoderSignalWait( p_dec );
- if( DecoderIsExitRequested( p_dec ) || DecoderIsFlushing( p_dec )
- || p_dec->b_error )
+ if( DecoderIsFlushing( p_dec ) || p_dec->b_error )
break;
p_vout = input_resource_HoldVout( p_owner->p_resource );
break;
p_vout = input_resource_HoldVout( p_owner->p_resource );