Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
146dad54
Commit
146dad54
authored
May 06, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use config_GetUserDataDir() internally
parent
0038469d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
14 deletions
+15
-14
src/control/media_library.c
src/control/media_library.c
+3
-2
src/libvlc-common.c
src/libvlc-common.c
+0
-2
src/libvlc.h
src/libvlc.h
+0
-1
src/playlist/loadsave.c
src/playlist/loadsave.c
+8
-6
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+4
-3
No files found.
src/control/media_library.c
View file @
146dad54
...
...
@@ -89,8 +89,7 @@ void
libvlc_media_library_load
(
libvlc_media_library_t
*
p_mlib
,
libvlc_exception_t
*
p_e
)
{
const
char
*
psz_datadir
=
libvlc_priv
(
p_mlib
->
p_libvlc_instance
->
p_libvlc_int
)
->
psz_datadir
;
char
*
psz_datadir
=
config_GetUserDataDir
();
char
*
psz_uri
;
if
(
!
psz_datadir
)
/* XXX: i doubt that this can ever happen */
...
...
@@ -102,9 +101,11 @@ libvlc_media_library_load( libvlc_media_library_t * p_mlib,
if
(
asprintf
(
&
psz_uri
,
"file/xspf-open://%s"
DIR_SEP
"ml.xsp"
,
psz_datadir
)
==
-
1
)
{
free
(
psz_datadir
);
libvlc_exception_raise
(
p_e
,
"Can't get create the path"
);
return
;
}
free
(
psz_datadir
);
if
(
p_mlib
->
p_mlist
)
libvlc_media_list_release
(
p_mlib
->
p_mlist
);
...
...
src/libvlc-common.c
View file @
146dad54
...
...
@@ -296,7 +296,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/* Set the config file stuff */
p_libvlc
->
psz_homedir
=
config_GetHomeDir
();
priv
->
psz_datadir
=
config_GetUserDataDir
();
priv
->
psz_configfile
=
config_GetCustomConfigFile
(
p_libvlc
);
/* Check for plugins cache options */
...
...
@@ -1060,7 +1059,6 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, bool b_release )
module_EndBank
(
p_libvlc
);
FREENULL
(
p_libvlc
->
psz_homedir
);
free
(
priv
->
psz_datadir
);
FREENULL
(
priv
->
psz_configfile
);
var_DelCallback
(
p_libvlc
,
"key-pressed"
,
vlc_key_to_action
,
p_libvlc
->
p_hotkeys
);
...
...
src/libvlc.h
View file @
146dad54
...
...
@@ -211,7 +211,6 @@ typedef struct libvlc_priv_t
/* Configuration */
vlc_mutex_t
config_lock
;
///< config file lock
char
*
psz_configfile
;
///< location of config file
char
*
psz_datadir
;
///< user data directory
/* There is no real reason to keep a list of items, but not to break
* everything, let's keep it */
...
...
src/playlist/loadsave.c
View file @
146dad54
...
...
@@ -108,7 +108,7 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
int
playlist_MLLoad
(
playlist_t
*
p_playlist
)
{
c
onst
char
*
psz_datadir
=
libvlc_priv
(
p_playlist
->
p_libvlc
)
->
psz_datadir
;
c
har
*
psz_datadir
=
config_GetUserDataDir
()
;
char
*
psz_uri
=
NULL
;
input_item_t
*
p_input
;
...
...
@@ -127,18 +127,18 @@ int playlist_MLLoad( playlist_t *p_playlist )
struct
stat
p_stat
;
/* checks if media library file is present */
if
(
utf8_stat
(
psz_uri
,
&
p_stat
)
)
{
free
(
psz_uri
);
return
VLC_EGENERIC
;
}
goto
error
;
free
(
psz_uri
);
/* FIXME: WTF? stat() should never be used right before open()! */
if
(
asprintf
(
&
psz_uri
,
"file/xspf-open://%s"
DIR_SEP
"ml.xspf"
,
psz_datadir
)
==
-
1
)
{
psz_uri
=
NULL
;
goto
error
;
}
free
(
psz_datadir
);
psz_datadir
=
NULL
;
const
char
*
const
psz_option
=
"meta-file"
;
/* that option has to be cleaned in input_item_subitem_added() */
...
...
@@ -183,12 +183,13 @@ int playlist_MLLoad( playlist_t *p_playlist )
error:
free
(
psz_uri
);
free
(
psz_datadir
);
return
VLC_ENOMEM
;
}
int
playlist_MLDump
(
playlist_t
*
p_playlist
)
{
char
*
psz_datadir
=
libvlc_priv
(
p_playlist
->
p_libvlc
)
->
psz_datadir
;
char
*
psz_datadir
=
config_GetUserDataDir
()
;
if
(
!
config_GetInt
(
p_playlist
,
"media-library"
)
)
return
VLC_SUCCESS
;
if
(
!
psz_datadir
)
/* XXX: This should never happen */
{
...
...
@@ -198,6 +199,7 @@ int playlist_MLDump( playlist_t *p_playlist )
char
psz_dirname
[
strlen
(
psz_datadir
)
+
sizeof
(
DIR_SEP
"ml.xspf"
)];
strcpy
(
psz_dirname
,
psz_datadir
);
free
(
psz_datadir
);
if
(
config_CreateDir
(
(
vlc_object_t
*
)
p_playlist
,
psz_dirname
)
)
{
return
VLC_EGENERIC
;
...
...
src/video_output/vout_intf.c
View file @
146dad54
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment