[vlc-commits] vout: separate stop event from reinit event
Rémi Denis-Courmont
git at videolan.org
Sat Jan 26 19:51:29 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jan 26 18:02:28 2019 +0200| [f852bfa70c9f4f8c47d2bb73dee9d600bccf2cba] | committer: Rémi Denis-Courmont
vout: separate stop event from reinit event
vout_Stop() only needs to deregister the mouse event handler; there is
essentially nothing in common with the vout_Request() REINIT control.
Eventually, vout_Stop() should probably do the ThreadStop() thing, but
that is not immediately possible - control requests may arrive before
the vout is restarted, and need to be processed.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f852bfa70c9f4f8c47d2bb73dee9d600bccf2cba
---
src/video_output/control.h | 1 +
src/video_output/video_output.c | 17 ++++-------------
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/src/video_output/control.h b/src/video_output/control.h
index e67ecf7da9..989ba9dd9a 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -45,6 +45,7 @@ enum {
VOUT_CONTROL_FLUSH, /* time */
VOUT_CONTROL_STEP, /* time_ptr */
+ VOUT_CONTROL_MOUSE_DISABLE,
VOUT_CONTROL_MOUSE_STATE, /* vlc_mouse_t */
VOUT_CONTROL_DISPLAY_SIZE, /* window */
VOUT_CONTROL_DISPLAY_FILLED, /* bool */
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index cb2eb688c7..0ca18e82b3 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -404,12 +404,7 @@ void vout_Stop(vout_thread_t *vout)
{
spu_Detach(vout->p->spu);
- vout_control_cmd_t cmd;
- vout_configuration_t cfg = { .fmt = NULL };
-
- vout_control_cmd_Init(&cmd, VOUT_CONTROL_REINIT);
- cmd.cfg = &cfg;
- vout_control_Push(&vout->p->control, &cmd);
+ vout_control_PushVoid(&vout->p->control, VOUT_CONTROL_MOUSE_DISABLE);
vout_control_WaitEmpty(&vout->p->control);
}
@@ -1737,13 +1732,6 @@ static void ThreadStop(vout_thread_t *vout)
static int ThreadReinit(vout_thread_t *vout,
const vout_configuration_t *cfg)
{
- if (!cfg->fmt)
- {
- vout->p->mouse_event = NULL;
- vout->p->opaque = NULL;
- return VLC_SUCCESS;
- }
-
vout->p->mouse_event = cfg->mouse_event;
vout->p->opaque = cfg->opaque;
@@ -1820,6 +1808,9 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
case VOUT_CONTROL_STEP:
ThreadStep(vout, cmd.time_ptr);
break;
+ case VOUT_CONTROL_MOUSE_DISABLE:
+ vout->p->mouse_event = NULL;
+ break;
case VOUT_CONTROL_MOUSE_STATE:
ThreadProcessMouseState(vout, &cmd.mouse);
break;
More information about the vlc-commits
mailing list