Commit 99f74096 authored by Thomas Guillem's avatar Thomas Guillem

decoder: add decoder_AbortPictures

parent 6c786aa5
......@@ -245,6 +245,16 @@ static inline picture_t *decoder_NewPicture( decoder_t *dec )
return decoder_GetPicture( dec );
}
/**
* Abort any calls of decoder_NewPicture / decoder_GetPicture
*
* If b_abort is true, all pending and futures calls of decoder_NewPicture /
* decoder_GetPicture will be aborted. This function can be used by
* asynchronous video decoders to unblock a thread that is waiting for a
* picture.
*/
VLC_API void decoder_AbortPictures( decoder_t *dec, bool b_abort );
/**
* This function queues a picture to the video output.
*
......
......@@ -593,6 +593,16 @@ int decoder_GetDisplayRate( decoder_t *p_dec )
return p_dec->pf_get_display_rate( p_dec );
}
void decoder_AbortPictures( decoder_t *p_dec, bool b_abort )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
vlc_mutex_lock( &p_owner->lock );
if( p_owner->p_vout != NULL )
vout_Cancel( p_owner->p_vout, b_abort );
vlc_mutex_unlock( &p_owner->lock );
}
static void DecoderWaitUnblock( decoder_t *p_dec )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
......
......@@ -73,6 +73,7 @@ date_Increment
date_Init
date_Move
date_Set
decoder_AbortPictures
decoder_GetDisplayDate
decoder_GetDisplayRate
decoder_GetInputAttachments
......
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