Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
216dff98
Commit
216dff98
authored
Dec 26, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist_queue: try open by URI first
If that fails, try opening the file as a stream.
parent
032354e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
playlist_queue.c
src/playlist_queue.c
+21
-10
No files found.
src/playlist_queue.c
View file @
216dff98
...
...
@@ -103,12 +103,30 @@ playlist_open_remote_into_queue(const char *uri, struct playlist *dest)
}
static
enum
playlist_result
playlist_open_
local_into_queue
(
const
char
*
uri
,
struct
playlist
*
dest
)
playlist_open_
path_into_queue
(
char
*
path_fs
,
struct
playlist
*
dest
)
{
struct
playlist_provider
*
playlist
;
struct
input_stream
is
;
enum
playlist_result
result
;
if
((
playlist
=
playlist_list_open_uri
(
path_fs
))
!=
NULL
)
result
=
playlist_load_into_queue
(
playlist
,
dest
);
else
if
((
playlist
=
playlist_list_open_path
(
&
is
,
path_fs
))
!=
NULL
)
{
result
=
playlist_load_into_queue
(
playlist
,
dest
);
input_stream_close
(
&
is
);
}
else
return
PLAYLIST_RESULT_NO_SUCH_LIST
;
playlist_plugin_close
(
playlist
);
return
result
;
}
static
enum
playlist_result
playlist_open_local_into_queue
(
const
char
*
uri
,
struct
playlist
*
dest
)
{
const
char
*
playlist_directory_fs
;
char
*
path_fs
;
struct
input_stream
is
;
enum
playlist_result
result
;
assert
(
spl_valid_name
(
uri
));
...
...
@@ -118,15 +136,8 @@ playlist_open_local_into_queue(const char *uri, struct playlist *dest)
return
PLAYLIST_RESULT_DISABLED
;
path_fs
=
g_build_filename
(
playlist_directory_fs
,
uri
,
NULL
);
playlist
=
playlist_list_open_path
(
&
is
,
path_fs
);
result
=
playlist_open_path_into_queue
(
path_fs
,
dest
);
g_free
(
path_fs
);
if
(
playlist
==
NULL
)
return
PLAYLIST_RESULT_NO_SUCH_LIST
;
result
=
playlist_load_into_queue
(
playlist
,
dest
);
playlist_plugin_close
(
playlist
);
input_stream_close
(
&
is
);
return
result
;
}
...
...
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