[vlc-devel] commit: Added CommonDisplay for msw. (Laurent Aimar )

git version control git at videolan.org
Mon Nov 2 20:07:11 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Nov  2 20:05:51 2009 +0100| [0c204dcbc2fa27984fba19a749a71c790f5a3af9] | committer: Laurent Aimar 

Added CommonDisplay for msw.

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

 modules/video_output/msw/common.c   |   24 ++++++++++++++++++++++++
 modules/video_output/msw/common.h   |    1 +
 modules/video_output/msw/direct3d.c |   17 ++---------------
 3 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c
index 83dac0b..5ff0f07 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -207,6 +207,30 @@ void CommonManage(vout_display_t *vd)
     EventThreadMouseAutoHide(sys->event);
 }
 
+/**
+ * It ensures that the video window is shown after the first picture
+ * is displayed.
+ */
+void CommonDisplay(vout_display_t *vd)
+{
+    vout_display_sys_t *sys = vd->sys;
+
+    if (!sys->is_first_display)
+        return;
+
+    /* Video window is initially hidden, show it now since we got a
+     * picture to show.
+     */
+    SetWindowPos(sys->hvideownd, 0, 0, 0, 0, 0,
+                 SWP_ASYNCWINDOWPOS|
+                 SWP_FRAMECHANGED|
+                 SWP_SHOWWINDOW|
+                 SWP_NOMOVE|
+                 SWP_NOSIZE|
+                 SWP_NOZORDER);
+    sys->is_first_display = false;
+}
+
 /*****************************************************************************
  * UpdateRects: update clipping rectangles
  *****************************************************************************
diff --git a/modules/video_output/msw/common.h b/modules/video_output/msw/common.h
index dc48711..b5bbe07 100644
--- a/modules/video_output/msw/common.h
+++ b/modules/video_output/msw/common.h
@@ -252,6 +252,7 @@ int  CommonInit(vout_display_t *);
 void CommonClean(vout_display_t *);
 void CommonManage(vout_display_t *);
 int  CommonControl(vout_display_t *, int , va_list );
+void CommonDisplay(vout_display_t *);
 
 void UpdateRects (vout_display_t *,
                   const vout_display_cfg_t *,
diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index d462435..856e196 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -277,27 +277,14 @@ static void Display(vout_display_t *vd, picture_t *picture)
     if (FAILED(hr)) {
         msg_Dbg(vd, "%s:%d (hr=0x%0lX)", __FUNCTION__, __LINE__, hr);
     }
-
-    if (sys->is_first_display) {
-        /* Video window is initially hidden, show it now since we got a
-         * picture to show.
-         */
-        SetWindowPos(vd->sys->hvideownd, 0, 0, 0, 0, 0,
-                     SWP_ASYNCWINDOWPOS|
-                     SWP_FRAMECHANGED|
-                     SWP_SHOWWINDOW|
-                     SWP_NOMOVE|
-                     SWP_NOSIZE|
-                     SWP_NOZORDER);
-        sys->is_first_display = false;
-    }
-
 #if 0
     VLC_UNUSED(picture);
 #else
     /* XXX See Prepare() */
     picture_Release(picture);
 #endif
+
+    CommonDisplay(vd);
 }
 static int ControlResetDevice(vout_display_t *vd)
 {




More information about the vlc-devel mailing list