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
c27fc26e
Commit
c27fc26e
authored
Jun 25, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist_list: probe plugin without MIME attributes
If the MIME type of a stream contains a semicolon, remove it and the text after it to probe for a playlist plugin.
parent
fba13bd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
playlist_list.c
src/playlist_list.c
+23
-3
No files found.
src/playlist_list.c
View file @
c27fc26e
...
...
@@ -190,12 +190,12 @@ playlist_list_open_uri(const char *uri)
}
static
struct
playlist_provider
*
playlist_list_open_stream_mime
(
struct
input_stream
*
is
)
playlist_list_open_stream_mime
2
(
struct
input_stream
*
is
,
const
char
*
mime
)
{
struct
playlist_provider
*
playlist
;
assert
(
is
!=
NULL
);
assert
(
is
->
mime
!=
NULL
);
assert
(
mime
!=
NULL
);
for
(
unsigned
i
=
0
;
playlist_plugins
[
i
]
!=
NULL
;
++
i
)
{
const
struct
playlist_plugin
*
plugin
=
playlist_plugins
[
i
];
...
...
@@ -203,7 +203,7 @@ playlist_list_open_stream_mime(struct input_stream *is)
if
(
playlist_plugins_enabled
[
i
]
&&
plugin
->
open_stream
!=
NULL
&&
plugin
->
mime_types
!=
NULL
&&
string_array_contains
(
plugin
->
mime_types
,
is
->
mime
))
{
string_array_contains
(
plugin
->
mime_types
,
mime
))
{
/* rewind the stream, so each plugin gets a
fresh start */
input_stream_seek
(
is
,
0
,
SEEK_SET
,
NULL
);
...
...
@@ -218,6 +218,26 @@ playlist_list_open_stream_mime(struct input_stream *is)
}
static
struct
playlist_provider
*
playlist_list_open_stream_mime
(
struct
input_stream
*
is
)
{
assert
(
is
->
mime
!=
NULL
);
const
char
*
semicolon
=
strchr
(
is
->
mime
,
';'
);
if
(
semicolon
==
NULL
)
return
playlist_list_open_stream_mime2
(
is
,
is
->
mime
);
if
(
semicolon
==
is
->
mime
)
return
NULL
;
/* probe only the portion before the semicolon*/
char
*
mime
=
g_strndup
(
is
->
mime
,
semicolon
-
is
->
mime
);
struct
playlist_provider
*
playlist
=
playlist_list_open_stream_mime2
(
is
,
mime
);
g_free
(
mime
);
return
playlist
;
}
static
struct
playlist_provider
*
playlist_list_open_stream_suffix
(
struct
input_stream
*
is
,
const
char
*
suffix
)
{
struct
playlist_provider
*
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