]> git.sesse.net Git - vlc/commitdiff
Simplify DX_DESKTOP_CHANGE case.
authorLaurent Aimar <fenrir@videolan.org>
Wed, 9 Sep 2009 20:21:22 +0000 (22:21 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 14 Sep 2009 18:18:42 +0000 (20:18 +0200)
modules/video_output/msw/direct3d.c
modules/video_output/msw/events.c
modules/video_output/msw/vout.h

index ed95fd2fd354157df91f1905740d652d98c7fb9a..50a8df64e6cef769d151b34e73af70b1aa1f8b1e 100644 (file)
@@ -359,22 +359,14 @@ static int Manage( vout_thread_t *p_vout )
     }
 
     /*
-            * Desktop mode change
-            */
+     * Desktop mode change
+     */
     if( p_vout->p_sys->i_changes & DX_DESKTOP_CHANGE )
     {
         /* Close the direct3d instance attached to the current output window. */
         End( p_vout );
         StopEventThread( p_vout );
-        /* Set the switching mode flag */
-        p_vout->p_sys->i_changes |= SWITCHING_MODE_FLAG;
-        /* Reset the flag */
-        p_vout->p_sys->i_changes &= ~DX_DESKTOP_CHANGE;
-    }
 
-    if( p_vout->p_sys->i_changes & EVENT_THREAD_ENDED
-        && p_vout->p_sys->i_changes & SWITCHING_MODE_FLAG )
-    {
         /* Open the direct3d output and attaches it to the new window */
         p_vout->p_sys->b_desktop = !p_vout->p_sys->b_desktop;
         p_vout->pf_display = FirstDisplay;
@@ -383,9 +375,8 @@ static int Manage( vout_thread_t *p_vout )
         CreateEventThread( p_vout );
         Init( p_vout );
 
-        /* Reset the flags */
-        p_vout->p_sys->i_changes &= ~EVENT_THREAD_ENDED;
-        p_vout->p_sys->i_changes &= ~SWITCHING_MODE_FLAG;
+        /* Reset the flag */
+        p_vout->p_sys->i_changes &= ~DX_DESKTOP_CHANGE;
     }
 
     /* autoscale toggle */
@@ -514,9 +505,6 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
 
     LPDIRECT3DDEVICE9       p_d3ddev = p_vout->p_sys->p_d3ddev;
 
-    if( p_vout->p_sys->i_changes & SWITCHING_MODE_FLAG )
-        return;
-
     // Present the back buffer contents to the display
     // stretching and filtering happens here
     HRESULT hr = IDirect3DDevice9_Present(p_d3ddev,
@@ -1290,9 +1278,6 @@ static void Direct3DVoutRenderScene( vout_thread_t *p_vout, picture_t *p_pic )
     HRESULT hr;
     float f_width, f_height;
 
-    if( p_vout->p_sys->i_changes & SWITCHING_MODE_FLAG )
-        return;
-
     // check if device is still available
     hr = IDirect3DDevice9_TestCooperativeLevel(p_d3ddev);
     if( FAILED(hr) )
index 493e2462e5a8ad3a39600fe1869632f0e1abe6e3..af2dc9b18add202213acdebaef7456d7395880fd 100644 (file)
@@ -396,10 +396,7 @@ static void *EventThread( void *p_this )
     msg_Dbg( p_vout, "DirectXEventThread terminating" );
 
     DirectXCloseWindow( p_event->p_vout );
-    vlc_restorecancel (canc);
-
-    /* clear the changes formerly signaled */
-    p_event->p_vout->p_sys->i_changes = EVENT_THREAD_ENDED;
+    vlc_restorecancel(canc);
     return NULL;
 }
 
@@ -971,6 +968,9 @@ static void EventThreadStop( event_thread_t *p_event )
 
     vlc_join( p_event->thread, NULL );
     p_event->b_ready = false;
+
+    /* clear the changes formerly signaled */
+    p_event->p_vout->p_sys->i_changes = 0;
 }
 
 /* */
index 87ef62f8b033ad6b78390f03fd980adf8e639edc..2ed551ba89071f3060ba52eb643e0c8b184ccaa2 100644 (file)
@@ -289,8 +289,6 @@ void RestoreScreensaver ( vout_thread_t *p_vout );
 #define DX_POSITION_CHANGE 0x1000
 #define DX_WALLPAPER_CHANGE 0x2000
 #define DX_DESKTOP_CHANGE 0x4000
-#define EVENT_THREAD_ENDED 0x6000
-#define SWITCHING_MODE_FLAG 0x8000
 
 /*****************************************************************************
  * WinCE helpers