]> git.sesse.net Git - vlc/commitdiff
* modules/video_output/directx/*: fixed strange race condition.
authorGildas Bazin <gbazin@videolan.org>
Tue, 23 Dec 2003 02:11:27 +0000 (02:11 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 23 Dec 2003 02:11:27 +0000 (02:11 +0000)
modules/video_output/directx/directx.c
modules/video_output/directx/events.c
modules/video_output/directx/vout.h

index e56f8a7b4c229a510ebf36e6c625eed2daf4526f..3971dcc439cfaff93de734719812ba22e9f4ae69 100644 (file)
@@ -2,7 +2,7 @@
  * vout.c: Windows DirectX video output display method
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: directx.c,v 1.29 2003/12/15 20:21:45 gbazin Exp $
+ * $Id: directx.c,v 1.30 2003/12/23 02:11:27 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -352,16 +352,8 @@ static int Init( vout_thread_t *p_vout )
     }
 
     /* Change the window title bar text */
-    if( p_vout->p_sys->hparent )
-        ; /* Do nothing */
-    else if( p_vout->p_sys->b_using_overlay )
-        SetWindowText( p_vout->p_sys->hwnd,
-                       VOUT_TITLE " (hardware YUV overlay DirectX output)" );
-    else if( p_vout->p_sys->b_hw_yuv )
-        SetWindowText( p_vout->p_sys->hwnd,
-                       VOUT_TITLE " (hardware YUV DirectX output)" );
-    else SetWindowText( p_vout->p_sys->hwnd,
-                        VOUT_TITLE " (software RGB DirectX output)" );
+    if( p_vout->p_sys->hparent ) ; /* Do nothing */
+    else PostMessage( p_vout->p_sys->hwnd, WM_VLC_CHANGE_TEXT, 0, 0 );
 
     return VLC_SUCCESS;
 }
index 44207162a5e3370317177ae2d22c89c2370c5b92..a360b1c0cf1bc686b6bc27463d2ecce8a50ffb85 100644 (file)
@@ -2,7 +2,7 @@
  * events.c: Windows DirectX video output events handler
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: events.c,v 1.33 2003/12/16 22:10:56 gbazin Exp $
+ * $Id: events.c,v 1.34 2003/12/23 02:11:27 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -94,7 +94,7 @@ void DirectXEventThread( event_thread_t *p_event )
         p_event->b_dead = VLC_TRUE;
     }
 
-    /* signal the creation of the window */
+    /* Signal the creation of the window */
     vlc_thread_ready( p_event );
 
     /* Main loop */
@@ -231,6 +231,17 @@ void DirectXEventThread( event_thread_t *p_event )
             }
             break;
 
+        case WM_VLC_CHANGE_TEXT:
+            if( p_event->p_vout->p_sys->b_using_overlay )
+                SetWindowText( p_event->p_vout->p_sys->hwnd,
+                    VOUT_TITLE " (hardware YUV overlay DirectX output)" );
+            else if( p_event->p_vout->p_sys->b_hw_yuv )
+                SetWindowText( p_event->p_vout->p_sys->hwnd,
+                    VOUT_TITLE " (hardware YUV DirectX output)" );
+            else SetWindowText( p_event->p_vout->p_sys->hwnd,
+                    VOUT_TITLE " (software RGB DirectX output)" );
+            break;
+
         default:
             /* Messages we don't handle directly are dispatched to the
              * window procedure */
@@ -661,6 +672,7 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
         }
         else
         {
+            msg_Warn( p_vout, "Created video sub-window" );
             SetWindowLong( p_vout->p_sys->hvideownd,
                            GWL_WNDPROC, (LONG)DirectXVideoEventProc );
         }
index 4aaf434c7fc8f19a42fb034526b1971171834eb2..a75466f2083134e0e587dbea32f1fc274075668f 100644 (file)
@@ -2,7 +2,7 @@
  * vout.h: Windows DirectX video output header file
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vout.h,v 1.10 2003/12/11 23:12:46 gbazin Exp $
+ * $Id: vout.h,v 1.11 2003/12/23 02:11:27 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -126,5 +126,6 @@ void DirectXUpdateRects ( vout_thread_t *p_vout, vlc_bool_t b_force );
 #define WM_VLC_HIDE_MOUSE WM_APP
 #define WM_VLC_CREATE_VIDEO_WIN WM_APP + 1
 #define WM_VLC_DESTROY_VIDEO_WIN WM_APP + 2
+#define WM_VLC_CHANGE_TEXT WM_APP + 3
 #define IDM_TOGGLE_ON_TOP WM_USER + 1
 #define DX_POSITION_CHANGE 0x1000