]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/skin_main.cpp
vout_window_t: simplify via anynomous union
[vlc] / modules / gui / skins2 / src / skin_main.cpp
index 6aa0e4782d891849bfe3081b6d1352eb4f8529e4..e650ac7de3aa2e5d3a7ed01180078a355f9bc430 100644 (file)
@@ -366,7 +366,6 @@ static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
 // Callbacks for vout requests
 static int WindowOpen( vlc_object_t *p_this )
 {
-    int i_ret;
     vout_window_t *pWnd = (vout_window_t *)p_this;
 
     vlc_mutex_lock( &skin_load.mutex );
@@ -378,11 +377,17 @@ static int WindowOpen( vlc_object_t *p_this )
     if( pIntf == NULL )
         return VLC_EGENERIC;
 
+    if( !config_GetInt( pIntf, "skinned-video") )
+    {
+        vlc_object_release( pIntf );
+        return VLC_EGENERIC;
+    }
+
     vlc_mutex_lock( &serializer );
 
-    pWnd->handle.hwnd = VoutManager::getWindow( pIntf, pWnd );
+    pWnd->hwnd = VoutManager::getWindow( pIntf, pWnd );
 
-    if( pWnd->handle.hwnd )
+    if( pWnd->hwnd )
     {
         pWnd->control = &VoutManager::controlWindow;
         pWnd->sys = (vout_window_sys_t*)pIntf;
@@ -566,6 +571,10 @@ static int onTaskBarChange( vlc_object_t *pObj, const char *pVariable,
     " correctly.")
 #define SKINS2_PLAYLIST N_("Use a skinned playlist")
 #define SKINS2_PLAYLIST_LONG N_("Use a skinned playlist")
+#define SKINS2_VIDEO N_("Display video in a skinned window if any")
+#define SKINS2_VIDEO_LONG N_( \
+    "When set to 'no', this parameter is intended to give old skins a chance" \
+    " to play back video even though no video tag is implemented")
 
 vlc_module_begin ()
     set_category( CAT_INTERFACE )
@@ -588,6 +597,8 @@ vlc_module_begin ()
 
     add_bool( "skinned-playlist", true, NULL, SKINS2_PLAYLIST,
               SKINS2_PLAYLIST_LONG, false );
+    add_bool( "skinned-video", true, NULL, SKINS2_VIDEO,
+              SKINS2_VIDEO_LONG, false );
     set_shortname( N_("Skins"))
     set_description( N_("Skinnable Interface") )
     set_capability( "interface", 30 )