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
c4dcc7a5
Commit
c4dcc7a5
authored
Jun 23, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist_MLLoad: format library URI correctly
parent
7521a562
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
src/playlist/loadsave.c
src/playlist/loadsave.c
+23
-24
No files found.
src/playlist/loadsave.c
View file @
c4dcc7a5
...
...
@@ -130,34 +130,39 @@ int playlist_MLLoad( playlist_t *p_playlist )
return
VLC_EGENERIC
;
}
if
(
asprintf
(
&
psz_uri
,
"%s"
DIR_SEP
"ml.xspf"
,
psz_datadir
)
==
-
1
)
{
psz_uri
=
NULL
;
goto
error
;
if
(
asprintf
(
&
psz_uri
,
"%s"
DIR_SEP
"ml.xspf"
,
psz_datadir
)
!=
-
1
)
{
/* loosy check for media library file */
struct
stat
st
;
int
ret
=
utf8_stat
(
psz_uri
,
&
st
);
free
(
psz_uri
);
if
(
ret
)
{
free
(
psz_datadir
);
return
VLC_EGENERIC
;
}
}
struct
stat
p_stat
;
/* checks if media library file is present */
if
(
utf8_stat
(
psz_uri
,
&
p_stat
)
)
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
=
make_URI
(
psz_datadir
);
free
(
psz_datadir
);
psz_datadir
=
psz_uri
;
if
(
psz_datadir
==
NULL
)
return
VLC_EGENERIC
;
if
(
asprintf
(
&
psz_uri
,
"%s/ml.xspf"
,
psz_datadir
)
==
-
1
)
psz_uri
=
NULL
;
goto
error
;
}
free
(
psz_datadir
);
psz_datadir
=
NULL
;
if
(
psz_uri
==
NULL
)
return
VLC_ENOMEM
;
const
char
*
const
psz_option
=
"meta-file"
;
const
char
*
const
options
[]
=
{
"meta-file"
,
"demux=xspf-open"
}
;
/* that option has to be cleaned in input_item_subitem_added() */
/* vlc_gc_decref() in the same function */
p_input
=
input_item_NewExt
(
p_playlist
,
psz_uri
,
_
(
"Media Library"
),
1
,
&
psz_option
,
VLC_INPUT_OPTION_TRUSTED
,
-
1
);
2
,
options
,
VLC_INPUT_OPTION_TRUSTED
,
-
1
);
free
(
psz_uri
);
if
(
p_input
==
NULL
)
goto
error
;
return
VLC_EGENERIC
;
PL_LOCK
;
if
(
p_playlist
->
p_ml_onelevel
->
p_input
)
...
...
@@ -189,13 +194,7 @@ int playlist_MLLoad( playlist_t *p_playlist )
input_item_subitem_added
,
p_playlist
);
vlc_gc_decref
(
p_input
);
free
(
psz_uri
);
return
VLC_SUCCESS
;
error:
free
(
psz_uri
);
free
(
psz_datadir
);
return
VLC_ENOMEM
;
}
int
playlist_MLDump
(
playlist_t
*
p_playlist
)
...
...
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