]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/directx.c
the vout might still run after the playlist termination, so we don't want to use...
[vlc] / modules / video_output / msw / directx.c
index 552db7d8033e5f64e9a4ccb999a4bd31e57d8f5c..cd8ed738c6450cde3a6bd868830b5db81172ee6e 100644 (file)
@@ -40,7 +40,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_interface.h>
 #include <vlc_playlist.h>
@@ -157,8 +157,8 @@ static int WallpaperCallback( vlc_object_t *, char const *,
     "background. Note that this feature only works in overlay mode and " \
     "the desktop must not already have a wallpaper." )
 
-static char *ppsz_dev[] = { "" };
-static char *ppsz_dev_text[] = { N_("Default") };
+static const char *const ppsz_dev[] = { "" };
+static const char *const ppsz_dev_text[] = { N_("Default") };
 
 vlc_module_begin();
     set_shortname( "DirectX" );
@@ -210,10 +210,7 @@ static int OpenVideo( vlc_object_t *p_this )
     /* Allocate structure */
     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
     if( p_vout->p_sys == NULL )
-    {
-        msg_Err( p_vout, "out of memory" );
         return VLC_ENOMEM;
-    }
     memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
 
     /* Initialisations */
@@ -2128,16 +2125,14 @@ static int WallpaperCallback( vlc_object_t *p_this, char const *psz_cmd,
     {
         playlist_t *p_playlist;
 
-        p_playlist =
-            (playlist_t *)vlc_object_find( p_this, VLC_OBJECT_PLAYLIST,
-                                           FIND_PARENT );
+        p_playlist = vlc_object_find( p_this,
+                                     VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
         if( p_playlist )
         {
             /* Modify playlist as well because the vout might have to be
              * restarted */
             var_Create( p_playlist, "directx-wallpaper", VLC_VAR_BOOL );
             var_Set( p_playlist, "directx-wallpaper", newval );
-
             vlc_object_release( p_playlist );
         }