Commit 5ac9185d authored by Thomas Guillem's avatar Thomas Guillem Committed by Rémi Denis-Courmont

vout: add vout_Cancel

This function will cancel the decoder picture pool.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent e4752428
......@@ -29,6 +29,7 @@ enum {
VOUT_CONTROL_INIT,
VOUT_CONTROL_CLEAN,
VOUT_CONTROL_REINIT, /* cfg */
VOUT_CONTROL_CANCEL,
#if 0
/* */
......
......@@ -303,6 +303,12 @@ static void VoutDestructor(vlc_object_t *object)
}
/* */
void vout_Cancel(vout_thread_t *vout)
{
vout_control_PushVoid(&vout->p->control, VOUT_CONTROL_CANCEL);
vout_control_WaitEmpty(&vout->p->control);
}
void vout_ChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
{
vout_control_cmd_t cmd;
......@@ -1447,6 +1453,11 @@ static int ThreadReinit(vout_thread_t *vout,
return VLC_SUCCESS;
}
static void ThreadCancel(vout_thread_t *vout)
{
picture_pool_Cancel(vout->p->decoder_pool);
}
static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
{
switch(cmd.type) {
......@@ -1466,6 +1477,9 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
if (ThreadReinit(vout, cmd.u.cfg))
return 1;
break;
case VOUT_CONTROL_CANCEL:
ThreadCancel(vout);
break;
case VOUT_CONTROL_SUBPICTURE:
ThreadDisplaySubpicture(vout, cmd.u.subpicture);
cmd.u.subpicture = NULL;
......
......@@ -52,6 +52,11 @@ void vout_Flush( vout_thread_t *p_vout, mtime_t i_date );
*/
void vout_Reset( vout_thread_t *p_vout );
/*
* Cancel the vout, it won't return any pictures after this call.
*/
void vout_Cancel( vout_thread_t *p_vout );
/**
* This function will force to display the next picture while paused
*/
......
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