[vlc-commits] ActiveX: Added checking of correct using of fullscreen support.

Sergey Radionov git at videolan.org
Tue Nov 8 02:18:54 CET 2011


npapi-vlc | branch: master | Sergey Radionov <RSATom at gmail.com> | Fri Jul 29 21:49:20 2011 +0700| [aa7e4f9f2fa07f192fbe9aa47f1c298fb9b225a1] | committer: Jean-Baptiste Kempf

ActiveX: Added checking of correct using of fullscreen support.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 activex/vlc_win32_fullscreen.cpp |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/activex/vlc_win32_fullscreen.cpp b/activex/vlc_win32_fullscreen.cpp
index 3fc06f5..fd08030 100644
--- a/activex/vlc_win32_fullscreen.cpp
+++ b/activex/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,5 +913,5 @@ 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