]> git.sesse.net Git - vlc/blobdiff - src/video_output/vout_intf.c
Use config_GetUserDataDir() internally
[vlc] / src / video_output / vout_intf.c
index f5211331aceade75dd10f7b27060d9c7a9ef7385..6218844119e4da1620e7b8167e4fc54adf861812 100644 (file)
@@ -637,12 +637,13 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
 #else
     /* XXX: This saves in the data directory. Shouldn't we try saving
      *      to psz_homedir/Desktop or something nicer ? */
-    if( !val.psz_string && libvlc_priv (p_vout->p_libvlc)->psz_datadir )
+    char *psz_datadir = config_GetUserDataDir();
+    if( !val.psz_string && psz_datadir )
     {
-        if( asprintf( &val.psz_string, "%s",
-                      libvlc_priv (p_vout->p_libvlc)->psz_datadir ) == -1 )
+        if( asprintf( &val.psz_string, "%s", psz_datadir ) == -1 )
             val.psz_string = NULL;
     }
+    free( psz_datadir );
 #endif
 
     if( !val.psz_string )