Commit b3f43c1d authored by Laurent Aimar's avatar Laurent Aimar

Simplify DX_DESKTOP_CHANGE case.

parent cadfc541
......@@ -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) )
......
......@@ -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;
}
/* */
......
......@@ -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
......
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