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
8bb35e7b
Commit
8bb35e7b
authored
Oct 25, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Thread: reimplement HasRemoteTagScanner() using the InputPlugin list
parent
3e78c9ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
Thread.cxx
src/decoder/Thread.cxx
+1
-8
Registry.cxx
src/input/Registry.cxx
+11
-0
Registry.hxx
src/input/Registry.hxx
+5
-0
No files found.
src/decoder/Thread.cxx
View file @
8bb35e7b
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "DecoderAPI.hxx"
#include "DecoderAPI.hxx"
#include "input/InputStream.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "input/LocalOpen.hxx"
#include "input/Registry.hxx"
#include "DecoderList.hxx"
#include "DecoderList.hxx"
#include "system/Error.hxx"
#include "system/Error.hxx"
#include "util/MimeType.hxx"
#include "util/MimeType.hxx"
...
@@ -432,14 +433,6 @@ try {
...
@@ -432,14 +433,6 @@ try {
error_uri
));
error_uri
));
}
}
gcc_pure
static
bool
HasRemoteTagScanner
(
const
char
*
uri
)
noexcept
{
return
StringStartsWith
(
uri
,
"tidal://"
)
||
StringStartsWith
(
uri
,
"qobuz://"
);
}
/**
/**
* Try to guess whether tags attached to the given song are
* Try to guess whether tags attached to the given song are
* "volatile", e.g. if they have been received by a live stream, but
* "volatile", e.g. if they have been received by a live stream, but
...
...
src/input/Registry.cxx
View file @
8bb35e7b
...
@@ -83,3 +83,14 @@ const InputPlugin *const input_plugins[] = {
...
@@ -83,3 +83,14 @@ const InputPlugin *const input_plugins[] = {
};
};
bool
input_plugins_enabled
[
ARRAY_SIZE
(
input_plugins
)
-
1
];
bool
input_plugins_enabled
[
ARRAY_SIZE
(
input_plugins
)
-
1
];
bool
HasRemoteTagScanner
(
const
char
*
uri
)
noexcept
{
input_plugins_for_each_enabled
(
plugin
)
if
(
plugin
->
scan_tags
!=
nullptr
&&
plugin
->
SupportsUri
(
uri
))
return
true
;
return
false
;
}
src/input/Registry.hxx
View file @
8bb35e7b
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#define MPD_INPUT_REGISTRY_HXX
#define MPD_INPUT_REGISTRY_HXX
#include "check.h"
#include "check.h"
#include "util/Compiler.h"
/**
/**
* NULL terminated list of all input plugins which were enabled at
* NULL terminated list of all input plugins which were enabled at
...
@@ -40,4 +41,8 @@ extern bool input_plugins_enabled[];
...
@@ -40,4 +41,8 @@ extern bool input_plugins_enabled[];
input_plugins_for_each(plugin) \
input_plugins_for_each(plugin) \
if (input_plugins_enabled[input_plugin_iterator - input_plugins])
if (input_plugins_enabled[input_plugin_iterator - input_plugins])
gcc_pure
bool
HasRemoteTagScanner
(
const
char
*
uri
)
noexcept
;
#endif
#endif
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