Commit 61fbbc30 authored by Laurent Aimar's avatar Laurent Aimar

Do not access p_vout->p_sys in events.c (msw).

It fixes the last cross accessed variables.
parent 96e12b04
...@@ -101,9 +101,25 @@ int CommonInit( vout_thread_t *p_vout ) ...@@ -101,9 +101,25 @@ int CommonInit( vout_thread_t *p_vout )
p_sys->p_event = EventThreadCreate( p_vout, &wnd_cfg ); p_sys->p_event = EventThreadCreate( p_vout, &wnd_cfg );
if( !p_sys->p_event ) if( !p_sys->p_event )
return VLC_EGENERIC; return VLC_EGENERIC;
if( EventThreadStart( p_sys->p_event ) )
event_cfg_t cfg;
memset(&cfg, 0, sizeof(cfg));
#ifdef MODULE_NAME_IS_direct3d
cfg.use_desktop = p_vout->p_sys->b_desktop;
#endif
#ifdef MODULE_NAME_IS_directx
cfg.use_overlay = p_vout->p_sys->b_using_overlay;
#endif
event_hwnd_t hwnd;
if( EventThreadStart( p_sys->p_event, &hwnd, &cfg ) )
return VLC_EGENERIC; return VLC_EGENERIC;
p_sys->parent_window = hwnd.parent_window;
p_sys->hparent = hwnd.hparent;
p_sys->hwnd = hwnd.hwnd;
p_sys->hvideownd = hwnd.hvideownd;
p_sys->hfswnd = hwnd.hfswnd;
/* Variable to indicate if the window should be on top of others */ /* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */ /* Trigger a callback right now */
var_TriggerCallback( p_vout, "video-on-top" ); var_TriggerCallback( p_vout, "video-on-top" );
......
...@@ -303,6 +303,8 @@ static void End( vout_thread_t *p_vout ) ...@@ -303,6 +303,8 @@ static void End( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
static int Manage( vout_thread_t *p_vout ) static int Manage( vout_thread_t *p_vout )
{ {
vout_sys_t *p_sys = p_vout->p_sys;
CommonManage( p_vout ); CommonManage( p_vout );
/* /*
...@@ -346,7 +348,18 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -346,7 +348,18 @@ static int Manage( vout_thread_t *p_vout )
p_vout->p_sys->b_desktop = !p_vout->p_sys->b_desktop; p_vout->p_sys->b_desktop = !p_vout->p_sys->b_desktop;
p_vout->pf_display = FirstDisplay; p_vout->pf_display = FirstDisplay;
EventThreadStart( p_vout->p_sys->p_event ); event_cfg_t cfg;
memset(&cfg, 0, sizeof(cfg));
cfg.use_desktop = p_vout->p_sys->b_desktop;
event_hwnd_t hwnd;
EventThreadStart( p_vout->p_sys->p_event, &hwnd, &cfg );
p_sys->parent_window = hwnd.parent_window;
p_sys->hparent = hwnd.hparent;
p_sys->hwnd = hwnd.hwnd;
p_sys->hvideownd = hwnd.hvideownd;
p_sys->hfswnd = hwnd.hfswnd;
Init( p_vout ); Init( p_vout );
......
This diff is collapsed.
...@@ -29,9 +29,22 @@ ...@@ -29,9 +29,22 @@
*/ */
typedef struct event_thread_t event_thread_t; typedef struct event_thread_t event_thread_t;
typedef struct {
bool use_desktop; /* direct3d */
bool use_overlay; /* directx */
} event_cfg_t;
typedef struct {
vout_window_t *parent_window;
HWND hparent;
HWND hwnd;
HWND hvideownd;
HWND hfswnd;
} event_hwnd_t;
event_thread_t *EventThreadCreate( vout_thread_t *, const vout_window_cfg_t * ); event_thread_t *EventThreadCreate( vout_thread_t *, const vout_window_cfg_t * );
void EventThreadDestroy( event_thread_t * ); void EventThreadDestroy( event_thread_t * );
int EventThreadStart( event_thread_t * ); int EventThreadStart( event_thread_t *, event_hwnd_t *, const event_cfg_t * );
void EventThreadStop( event_thread_t * ); void EventThreadStop( event_thread_t * );
void EventThreadMouseAutoHide( event_thread_t * ); void EventThreadMouseAutoHide( event_thread_t * );
......
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