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
7de6e4db
Commit
7de6e4db
authored
6 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/Registry: eliminate MIME type copy
parent
15dbb808
sisyphus
0.23.15-alt1
0.23.14-alt1
0.23.13-alt1
0.23.12-alt1
0.23.11-alt1
0.23.8-alt3
0.23.8-alt2
0.23.8-alt1
gb-sisyphus-task339776.6100
gb-sisyphus-task337393.100
gb-sisyphus-task337176.300
gb-sisyphus-task334590.100
gb-sisyphus-task333607.100
gb-sisyphus-task331543.2500
gb-sisyphus-task328663.4700
gb-sisyphus-task325064.100
gb-sisyphus-task319111.4000
gb-sisyphus-task313704.100
gb-sisyphus-task312885.100
gb-sisyphus-task308905.3200
gb-sisyphus-task305294.500
gb-sisyphus-task304007.100
gb-sisyphus-task303674.1700
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
PlaylistRegistry.cxx
src/playlist/PlaylistRegistry.cxx
+17
-10
No files found.
src/playlist/PlaylistRegistry.cxx
View file @
7de6e4db
...
...
@@ -201,22 +201,29 @@ playlist_list_open_stream_mime2(InputStreamPtr &&is, StringView mime)
return
nullptr
;
}
/**
* Extract the "main" part of a MIME type string, i.e. the portion
* before the semicolon (if one exists).
*/
gcc_pure
static
StringView
ExtractMimeTypeMainPart
(
StringView
s
)
noexcept
{
const
auto
separator
=
s
.
Find
(
';'
);
if
(
separator
!=
nullptr
)
s
.
SetEnd
(
separator
);
return
s
;
}
static
std
::
unique_ptr
<
SongEnumerator
>
playlist_list_open_stream_mime
(
InputStreamPtr
&&
is
,
const
char
*
full_mime
)
{
assert
(
full_mime
!=
nullptr
);
const
char
*
semicolon
=
strchr
(
full_mime
,
';'
);
if
(
semicolon
==
nullptr
)
return
playlist_list_open_stream_mime2
(
std
::
move
(
is
),
full_mime
);
if
(
semicolon
==
full_mime
)
return
nullptr
;
/* probe only the portion before the semicolon*/
const
std
::
string
mime
(
full_mime
,
semicolon
);
return
playlist_list_open_stream_mime2
(
std
::
move
(
is
),
mime
.
c_str
(
));
return
playlist_list_open_stream_mime2
(
std
::
move
(
is
),
ExtractMimeTypeMainPart
(
full_mime
));
}
std
::
unique_ptr
<
SongEnumerator
>
...
...
This diff is collapsed.
Click to expand it.
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