[vlc-commits] vout:win32: init the event_thread video placement outside of EventThreadCreate

Steve Lhomme git at videolan.org
Tue Apr 2 16:32:45 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 26 12:46:52 2019 +0100| [cae14dc808153bf7f269fe7ea1eab5ecd9811cff] | committer: Steve Lhomme

vout:win32: init the event_thread video placement outside of EventThreadCreate

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cae14dc808153bf7f269fe7ea1eab5ecd9811cff
---

 modules/video_output/win32/common.c | 6 +++++-
 modules/video_output/win32/events.c | 9 +++++++--
 modules/video_output/win32/events.h | 2 +-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 1c2df69230..c5077df604 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -101,10 +101,14 @@ int CommonInit(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_
     var_Create(vd, "video-deco", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
 
     /* */
-    sys->event = EventThreadCreate(vd, &area->vdcfg, area->vdcfg.window);
+    sys->event = EventThreadCreate(vd, area->vdcfg.window);
     if (!sys->event)
         return VLC_EGENERIC;
 
+    vout_display_place_t original_place;
+    vout_display_PlacePicture(&original_place, &vd->source, &area->vdcfg);
+    EventThreadUpdatePlace(sys->event, &original_place);
+
     event_cfg_t cfg;
     memset(&cfg, 0, sizeof(cfg));
 #ifdef MODULE_NAME_IS_direct3d9
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 892c6af646..50648b09a6 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -420,7 +420,7 @@ bool EventThreadGetAndResetSizeChanged( event_thread_t *p_event )
     return atomic_exchange(&p_event->size_changed, false);
 }
 
-event_thread_t *EventThreadCreate( vout_display_t *vd, const vout_display_cfg_t *vdcfg, vout_window_t *parent_window)
+event_thread_t *EventThreadCreate( vout_display_t *vd, vout_window_t *parent_window)
 {
     if (parent_window->type != VOUT_WINDOW_TYPE_HWND &&
         !(parent_window->type == VOUT_WINDOW_TYPE_DUMMY && parent_window->handle.hwnd == 0))
@@ -448,7 +448,12 @@ event_thread_t *EventThreadCreate( vout_display_t *vd, const vout_display_cfg_t
     p_event->psz_title = NULL;
     p_event->hwnd = NULL;
     atomic_init(&p_event->size_changed, false);
-    vout_display_PlacePicture(&p_event->place, &vd->source, vdcfg);
+
+    /* initialized to 0 to match the init in the display_win32_area_t */
+    p_event->place.x = 0;
+    p_event->place.y = 0;
+    p_event->place.width = 0;
+    p_event->place.height = 0;
 
     _sntprintf( p_event->class_main, ARRAYSIZE(p_event->class_main),
                _T("VLC video main %p"), (void *)p_event );
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index 7df709479e..1149b1f5d4 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -45,7 +45,7 @@ typedef struct {
     HWND hfswnd;
 } event_hwnd_t;
 
-event_thread_t *EventThreadCreate( vout_display_t *, const vout_display_cfg_t *, vout_window_t *);
+event_thread_t *EventThreadCreate( vout_display_t *, vout_window_t *);
 void            EventThreadDestroy( event_thread_t * );
 int             EventThreadStart( event_thread_t *, event_hwnd_t *, const event_cfg_t * );
 void            EventThreadStop( event_thread_t * );



More information about the vlc-commits mailing list