[vlc-commits] vout: actually stop the vout thread in vout_Stop()
Rémi Denis-Courmont
git at videolan.org
Sun Feb 24 12:51:42 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 24 10:58:44 2019 +0200| [012d9435ffeb5ae7dddc4a640b35fb79d7359262] | committer: Rémi Denis-Courmont
vout: actually stop the vout thread in vout_Stop()
This factors the vout thread stopping code from vout_Request() and
vout_Close() into vout_Stop(). vout_Request() now calls vout_Stop() when
it attempts to recycle an active vout (but not a stopped vout). Likewise
vout_Close() calls vout_Stop() if the vout being destroyed is active.
This makes no practical externally visible differences, but it is a
prerequisite to support creating a vout thread in stopped state.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=012d9435ffeb5ae7dddc4a640b35fb79d7359262
---
src/video_output/video_output.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 9e87dbfb6d..e723be87cc 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1581,11 +1581,14 @@ void vout_Stop(vout_thread_t *vout)
{
vout_thread_sys_t *sys = vout->p;
- spu_Detach(sys->spu);
+ assert(sys->original.i_chroma != 0);
+ vout_control_PushVoid(&sys->control, VOUT_CONTROL_CLEAN);
+ vlc_join(sys->thread, NULL);
- vout_control_Hold(&sys->control);
+ spu_Detach(sys->spu);
sys->mouse_event = NULL;
- vout_control_Release(&sys->control);
+ video_format_Clean(&sys->original);
+ sys->original.i_chroma = 0;
}
void vout_Close(vout_thread_t *vout)
@@ -1594,15 +1597,12 @@ void vout_Close(vout_thread_t *vout)
vout_thread_sys_t *sys = vout->p;
- vout_IntfDeinit(VLC_OBJECT(vout));
+ if (sys->original.i_chroma != 0)
+ vout_Stop(vout);
- spu_Detach(sys->spu);
+ vout_IntfDeinit(VLC_OBJECT(vout));
vout_snapshot_End(sys->snapshot);
-
- vout_control_PushVoid(&sys->control, VOUT_CONTROL_CLEAN);
vout_control_Dead(&sys->control);
- vlc_join(sys->thread, NULL);
-
vout_chrono_Clean(&sys->render);
vlc_mutex_destroy(&sys->window_lock);
@@ -1672,6 +1672,7 @@ static vout_thread_t *VoutCreate(vlc_object_t *object)
}
sys->input = NULL;
+ sys->original.i_chroma = 0;
sys->source.dar.num = 0;
sys->source.dar.den = 0;
sys->source.crop.mode = VOUT_CROP_NONE;
@@ -1755,13 +1756,10 @@ vout_thread_t *vout_Request(vlc_object_t *object,
msg_Warn(vout, "DPB need to be increased");
}
- vout_control_PushVoid(&sys->control, VOUT_CONTROL_CLEAN);
- msg_Dbg(object, "reusing provided vout");
- vlc_join(sys->thread, NULL);
+ if (sys->original.i_chroma != 0)
+ vout_Stop(vout);
vout_ReinitInterlacingSupport(vout);
-
- video_format_Clean(&sys->original);
sys->original = original;
vlc_mutex_lock(&vout->p->window_lock);
More information about the vlc-commits
mailing list