[vlc-commits] Win32, Added checking of correct using of fullscreen support
Sergey Radionov
git at videolan.org
Mon Aug 1 12:55:43 CEST 2011
npapi-vlc | branch: master | Sergey Radionov <rsatom at gmail.com> | Mon Aug 1 12:55:16 2011 +0200| [ff51d50f335b0a903c945176991e7a4bf5173374] | committer: Jean-Baptiste Kempf
Win32, Added checking of correct using of fullscreen support
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=ff51d50f335b0a903c945176991e7a4bf5173374
---
npapi/vlc_win32_fullscreen.cpp | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/npapi/vlc_win32_fullscreen.cpp b/npapi/vlc_win32_fullscreen.cpp
index 93801d6..abad74b 100644
--- a/npapi/vlc_win32_fullscreen.cpp
+++ b/npapi/vlc_win32_fullscreen.cpp
@@ -844,17 +844,27 @@ void VLCWindowsManager::DestroyWindows()
void VLCWindowsManager::LibVlcAttach(libvlc_media_player_t* p_md)
{
+ if(!_HolderWnd)
+ return;//VLCWindowsManager::CreateWindows was not called
+
_p_md=p_md;
libvlc_media_player_set_hwnd(p_md, _HolderWnd->getHWND());
}
void VLCWindowsManager::LibVlcDetach()
{
+ if(_p_md){
+ libvlc_media_player_set_hwnd(_p_md, 0);
+ }
+
_p_md=0;
}
void VLCWindowsManager::StartFullScreen()
{
+ if(!_HolderWnd)
+ return;//VLCWindowsManager::CreateWindows was not called
+
if(getMD()&&!IsFullScreen()){
if(!_FSWnd){
_FSWnd= VLCFullScreenWnd::CreateFSWindow(this);
@@ -871,6 +881,9 @@ void VLCWindowsManager::StartFullScreen()
void VLCWindowsManager::EndFullScreen()
{
+ if(!_HolderWnd)
+ return;//VLCWindowsManager::CreateWindows was not called
+
if(IsFullScreen()){
SetParent(_HolderWnd->getHWND(), _hWindowedParentWnd);
@@ -900,6 +913,6 @@ void VLCWindowsManager::ToggleFullScreen()
bool VLCWindowsManager::IsFullScreen()
{
- return 0!=_FSWnd && GetParent(_HolderWnd->getHWND())==_FSWnd->getHWND();
+ return 0!=_FSWnd && 0!=_HolderWnd && GetParent(_HolderWnd->getHWND())==_FSWnd->getHWND();
}
More information about the vlc-commits
mailing list