[vlc-commits] vout: stop the thread on reinit
Rémi Denis-Courmont
git at videolan.org
Sun Jan 27 22:10:16 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 27 21:58:31 2019 +0200| [320b728eb1e6ce4f78da066c63111f9f63716605] | committer: Rémi Denis-Courmont
vout: stop the thread on reinit
This enables sharing per-format initialization code between the initial
initialization and reinitialization cases.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=320b728eb1e6ce4f78da066c63111f9f63716605
---
src/video_output/video_output.c | 41 ++++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index ef9d36c7bc..0c063dc679 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1810,6 +1810,7 @@ vout_thread_t *vout_Request(vlc_object_t *object,
if (vout) {
video_format_t original;
+ sys = vout->p;
VoutFixFormat(&original, cfg->fmt);
/* TODO: If dimensions are equal or slightly smaller, update the aspect
@@ -1824,19 +1825,21 @@ vout_thread_t *vout_Request(vlc_object_t *object,
msg_Warn(vout, "DPB need to be increased");
}
- vout_control_cmd_t cmd;
-
- vout_control_cmd_Init(&cmd, VOUT_CONTROL_REINIT);
- cmd.cfg = cfg;
- vout_control_Push(&vout->p->control, &cmd);
+ vout_control_PushVoid(&sys->control, VOUT_CONTROL_CLEAN);
msg_Dbg(object, "reusing provided vout");
+ vlc_join(sys->thread, NULL);
- vout_control_WaitEmpty(&vout->p->control);
- if (vout->p->dead) {
- msg_Err(vout, "video output creation failed");
- vout_Close(vout);
- return NULL;
- }
+ sys->dead = false;
+ sys->mouse_event = cfg->mouse_event;
+ sys->opaque = cfg->opaque;
+ sys->pause.is_on = false;
+ sys->pause.date = VLC_TICK_INVALID;
+
+ vout_ReinitInterlacingSupport(vout);
+
+ video_format_Clean(&sys->original);
+ VoutFixFormat(&sys->original, cfg->fmt);
+ sys->dpb_size = cfg->dpb_size;
vlc_mutex_lock(&vout->p->window_lock);
vout_ControlUpdateWindowSize(vout);
@@ -1849,15 +1852,15 @@ vout_thread_t *vout_Request(vlc_object_t *object,
sys = vout->p;
if (input != NULL)
vout->p->input = vlc_object_hold((vlc_object_t *)input);
+ }
- if (vout_Start(vout)
- || vlc_clone(&sys->thread, Thread, vout,
- VLC_THREAD_PRIORITY_OUTPUT)) {
- vout_display_window_Delete(sys->display_cfg.window);
- spu_Destroy(sys->spu);
- vlc_object_release(vout);
- return NULL;
- }
+ if (vout_Start(vout)
+ || vlc_clone(&sys->thread, Thread, vout, VLC_THREAD_PRIORITY_OUTPUT)) {
+ msg_Err(vout, "video output creation failed");
+ vout_display_window_Delete(sys->display_cfg.window);
+ spu_Destroy(sys->spu);
+ vlc_object_release(vout);
+ return NULL;
}
if (input != NULL)
More information about the vlc-commits
mailing list