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
34174cd2
Commit
34174cd2
authored
Feb 14, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: indirectly write when exporting to ml.xspf
parent
e7847d8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
src/playlist/loadsave.c
src/playlist/loadsave.c
+24
-7
No files found.
src/playlist/loadsave.c
View file @
34174cd2
...
...
@@ -182,19 +182,19 @@ int playlist_MLLoad( playlist_t *p_playlist )
int
playlist_MLDump
(
playlist_t
*
p_playlist
)
{
char
*
psz_
datadir
;
char
*
psz_
temp
;
psz_
datadir
=
config_GetUserDir
(
VLC_DATA_DIR
);
psz_
temp
=
config_GetUserDir
(
VLC_DATA_DIR
);
if
(
!
psz_
datadir
)
/* XXX: This should never happen */
if
(
!
psz_
temp
)
/* XXX: This should never happen */
{
msg_Err
(
p_playlist
,
"no data directory, cannot save media library"
)
;
return
VLC_EGENERIC
;
}
char
psz_dirname
[
strlen
(
psz_
datadir
)
+
sizeof
(
DIR_SEP
"ml.xspf"
)];
strcpy
(
psz_dirname
,
psz_
datadir
);
free
(
psz_
datadir
);
char
psz_dirname
[
strlen
(
psz_
temp
)
+
sizeof
(
DIR_SEP
"ml.xspf"
)];
strcpy
(
psz_dirname
,
psz_
temp
);
free
(
psz_
temp
);
if
(
config_CreateDir
(
(
vlc_object_t
*
)
p_playlist
,
psz_dirname
)
)
{
return
VLC_EGENERIC
;
...
...
@@ -202,8 +202,25 @@ int playlist_MLDump( playlist_t *p_playlist )
strcat
(
psz_dirname
,
DIR_SEP
"ml.xspf"
);
playlist_Export
(
p_playlist
,
psz_dirname
,
p_playlist
->
p_media_library
,
if
(
asprintf
(
&
psz_temp
,
"%s.tmp"
,
psz_dirname
)
<
1
)
return
VLC_EGENERIC
;
int
i_ret
=
playlist_Export
(
p_playlist
,
psz_temp
,
p_playlist
->
p_media_library
,
"export-xspf"
);
if
(
i_ret
!=
VLC_SUCCESS
)
{
vlc_unlink
(
psz_temp
);
free
(
psz_temp
);
return
i_ret
;
}
i_ret
=
vlc_rename
(
psz_temp
,
psz_dirname
);
free
(
psz_temp
);
if
(
i_ret
==
-
1
)
{
msg_Err
(
p_playlist
,
"could not rename %s.tmp: %s"
,
psz_dirname
,
vlc_strerror_c
(
errno
)
);
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
}
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