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
ccc58f2a
Commit
ccc58f2a
authored
Apr 18, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.21.x'
parents
d28307e0
ead3dc6a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
60 additions
and
25 deletions
+60
-25
NEWS
NEWS
+3
-0
meson.build
meson.build
+3
-1
CommandLine.cxx
src/CommandLine.cxx
+8
-8
LocateUri.cxx
src/LocateUri.cxx
+18
-5
LocateUri.hxx
src/LocateUri.hxx
+8
-1
SongLoader.cxx
src/SongLoader.cxx
+2
-1
FileCommands.cxx
src/command/FileCommands.cxx
+2
-2
FingerprintCommands.cxx
src/command/FingerprintCommands.cxx
+1
-1
OtherCommands.cxx
src/command/OtherCommands.cxx
+2
-2
PlaylistCommands.cxx
src/command/PlaylistCommands.cxx
+6
-3
QueueCommands.cxx
src/command/QueueCommands.cxx
+2
-1
meson.build
src/db/meson.build
+5
-0
No files found.
NEWS
View file @
ccc58f2a
...
@@ -12,8 +12,11 @@ ver 0.21.8 (not yet released)
...
@@ -12,8 +12,11 @@ ver 0.21.8 (not yet released)
* output
* output
- httpd: add missing mutex lock
- httpd: add missing mutex lock
- httpd: fix use-after-free bug
- httpd: fix use-after-free bug
* playlist
- soundcloud: fix "Unsupported URI scheme" (0.21.6 regression)
* fix Bonjour bug
* fix Bonjour bug
* fix build failure with GCC 9
* fix build failure with GCC 9
* fix build failure with -Ddatabase=false
* systemd: add user socket unit
* systemd: add user socket unit
ver 0.21.7 (2019/04/03)
ver 0.21.7 (2019/04/03)
...
...
meson.build
View file @
ccc58f2a
...
@@ -377,8 +377,10 @@ basic_dep = declare_dependency(
...
@@ -377,8 +377,10 @@ basic_dep = declare_dependency(
if enable_database
if enable_database
subdir('src/storage')
subdir('src/storage')
subdir('src/db')
else
storage_glue_dep = dependency('', required: false)
endif
endif
subdir('src/db')
if neighbor_glue_dep.found()
if neighbor_glue_dep.found()
sources += 'src/command/NeighborCommands.cxx'
sources += 'src/command/NeighborCommands.cxx'
...
...
src/CommandLine.cxx
View file @
ccc58f2a
...
@@ -108,17 +108,17 @@ static constexpr Domain cmdline_domain("cmdline");
...
@@ -108,17 +108,17 @@ static constexpr Domain cmdline_domain("cmdline");
gcc_noreturn
gcc_noreturn
static
void
version
(
void
)
static
void
version
(
void
)
{
{
printf
(
"Music Player Daemon "
VERSION
" (%s)
\n
"
printf
(
"Music Player Daemon "
VERSION
" (%s)"
"
\n
"
"
\n
"
"Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
\n
"
"Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
\n
"
"Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
\n
"
"Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
\n
"
"This is free software; see the source for copying conditions. There is NO
\n
"
"This is free software; see the source for copying conditions. There is NO
\n
"
"warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\n
"
"warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\n
"
,
GIT_VERSION
);
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
"
\n
"
printf
(
"
\n
"
"Database plugins:
\n
"
,
"Database plugins:
\n
"
);
GIT_VERSION
);
for
(
auto
i
=
database_plugins
;
*
i
!=
nullptr
;
++
i
)
for
(
auto
i
=
database_plugins
;
*
i
!=
nullptr
;
++
i
)
printf
(
" %s"
,
(
*
i
)
->
name
);
printf
(
" %s"
,
(
*
i
)
->
name
);
...
@@ -129,18 +129,18 @@ static void version(void)
...
@@ -129,18 +129,18 @@ static void version(void)
for
(
auto
i
=
storage_plugins
;
*
i
!=
nullptr
;
++
i
)
for
(
auto
i
=
storage_plugins
;
*
i
!=
nullptr
;
++
i
)
printf
(
" %s"
,
(
*
i
)
->
name
);
printf
(
" %s"
,
(
*
i
)
->
name
);
printf
(
"
\n
"
printf
(
"
\n
"
);
#endif
#endif
#ifdef ENABLE_NEIGHBOR_PLUGINS
#ifdef ENABLE_NEIGHBOR_PLUGINS
"
\n
"
printf
(
"
\n
"
"Neighbor plugins:
\n
"
);
"Neighbor plugins:
\n
"
);
for
(
auto
i
=
neighbor_plugins
;
*
i
!=
nullptr
;
++
i
)
for
(
auto
i
=
neighbor_plugins
;
*
i
!=
nullptr
;
++
i
)
printf
(
" %s"
,
(
*
i
)
->
name
);
printf
(
" %s"
,
(
*
i
)
->
name
);
printf
(
"
\n
"
#endif
#endif
printf
(
"
\n
"
"
\n
"
"
\n
"
"Decoders plugins:
\n
"
);
"Decoders plugins:
\n
"
);
...
...
src/LocateUri.cxx
View file @
ccc58f2a
...
@@ -55,14 +55,26 @@ LocateFileUri(const char *uri, const Client *client
...
@@ -55,14 +55,26 @@ LocateFileUri(const char *uri, const Client *client
}
}
static
LocatedUri
static
LocatedUri
LocateAbsoluteUri
(
const
char
*
uri
LocateAbsoluteUri
(
UriPluginKind
kind
,
const
char
*
uri
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
const
Storage
*
storage
,
const
Storage
*
storage
#endif
#endif
)
)
{
{
if
(
!
uri_supported_scheme
(
uri
))
switch
(
kind
)
{
throw
std
::
runtime_error
(
"Unsupported URI scheme"
);
case
UriPluginKind
:
:
INPUT
:
case
UriPluginKind
:
:
STORAGE
:
// TODO: separate check for storage plugins
if
(
!
uri_supported_scheme
(
uri
))
throw
std
::
runtime_error
(
"Unsupported URI scheme"
);
break
;
case
UriPluginKind
:
:
PLAYLIST
:
/* for now, no validation for playlist URIs; this is
more complicated because there are three ways to
identify which plugin to use: URI scheme, filename
suffix and MIME type */
break
;
}
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
if
(
storage
!=
nullptr
)
{
if
(
storage
!=
nullptr
)
{
...
@@ -76,7 +88,8 @@ LocateAbsoluteUri(const char *uri
...
@@ -76,7 +88,8 @@ LocateAbsoluteUri(const char *uri
}
}
LocatedUri
LocatedUri
LocateUri
(
const
char
*
uri
,
const
Client
*
client
LocateUri
(
UriPluginKind
kind
,
const
char
*
uri
,
const
Client
*
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
const
Storage
*
storage
,
const
Storage
*
storage
#endif
#endif
...
@@ -100,7 +113,7 @@ LocateUri(const char *uri, const Client *client
...
@@ -100,7 +113,7 @@ LocateUri(const char *uri, const Client *client
#endif
#endif
);
);
else
if
(
uri_has_scheme
(
uri
))
else
if
(
uri_has_scheme
(
uri
))
return
LocateAbsoluteUri
(
uri
return
LocateAbsoluteUri
(
kind
,
uri
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
storage
,
storage
#endif
#endif
...
...
src/LocateUri.hxx
View file @
ccc58f2a
...
@@ -41,6 +41,12 @@ class Client;
...
@@ -41,6 +41,12 @@ class Client;
class
Storage
;
class
Storage
;
#endif
#endif
enum
class
UriPluginKind
{
INPUT
,
STORAGE
,
PLAYLIST
,
};
struct
LocatedUri
{
struct
LocatedUri
{
enum
class
Type
{
enum
class
Type
{
/**
/**
...
@@ -84,7 +90,8 @@ struct LocatedUri {
...
@@ -84,7 +90,8 @@ struct LocatedUri {
* that feature is disabled if this parameter is nullptr
* that feature is disabled if this parameter is nullptr
*/
*/
LocatedUri
LocatedUri
LocateUri
(
const
char
*
uri
,
const
Client
*
client
LocateUri
(
UriPluginKind
kind
,
const
char
*
uri
,
const
Client
*
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
const
Storage
*
storage
,
const
Storage
*
storage
#endif
#endif
...
...
src/SongLoader.cxx
View file @
ccc58f2a
...
@@ -94,7 +94,8 @@ SongLoader::LoadSong(const char *uri_utf8) const
...
@@ -94,7 +94,8 @@ SongLoader::LoadSong(const char *uri_utf8) const
assert
(
uri_utf8
!=
nullptr
);
assert
(
uri_utf8
!=
nullptr
);
#endif
#endif
const
auto
located_uri
=
LocateUri
(
uri_utf8
,
client
const
auto
located_uri
=
LocateUri
(
UriPluginKind
::
INPUT
,
uri_utf8
,
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
storage
,
storage
#endif
#endif
...
...
src/command/FileCommands.cxx
View file @
ccc58f2a
...
@@ -218,7 +218,7 @@ handle_read_comments(Client &client, Request args, Response &r)
...
@@ -218,7 +218,7 @@ handle_read_comments(Client &client, Request args, Response &r)
const
char
*
const
uri
=
args
.
front
();
const
char
*
const
uri
=
args
.
front
();
const
auto
located_uri
=
LocateUri
(
uri
,
&
client
const
auto
located_uri
=
LocateUri
(
UriPluginKind
::
INPUT
,
uri
,
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
@@ -331,7 +331,7 @@ handle_album_art(Client &client, Request args, Response &r)
...
@@ -331,7 +331,7 @@ handle_album_art(Client &client, Request args, Response &r)
const
char
*
uri
=
args
.
front
();
const
char
*
uri
=
args
.
front
();
size_t
offset
=
args
.
ParseUnsigned
(
1
);
size_t
offset
=
args
.
ParseUnsigned
(
1
);
const
auto
located_uri
=
LocateUri
(
uri
,
&
client
const
auto
located_uri
=
LocateUri
(
UriPluginKind
::
INPUT
,
uri
,
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
...
src/command/FingerprintCommands.cxx
View file @
ccc58f2a
...
@@ -314,7 +314,7 @@ handle_getfingerprint(Client &client, Request args, Response &)
...
@@ -314,7 +314,7 @@ handle_getfingerprint(Client &client, Request args, Response &)
{
{
const
char
*
_uri
=
args
.
front
();
const
char
*
_uri
=
args
.
front
();
auto
lu
=
LocateUri
(
_uri
,
&
client
auto
lu
=
LocateUri
(
UriPluginKind
::
INPUT
,
_uri
,
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
...
src/command/OtherCommands.cxx
View file @
ccc58f2a
...
@@ -99,7 +99,7 @@ handle_listfiles(Client &client, Request args, Response &r)
...
@@ -99,7 +99,7 @@ handle_listfiles(Client &client, Request args, Response &r)
/* default is root directory */
/* default is root directory */
const
auto
uri
=
args
.
GetOptional
(
0
,
""
);
const
auto
uri
=
args
.
GetOptional
(
0
,
""
);
const
auto
located_uri
=
LocateUri
(
uri
,
&
client
const
auto
located_uri
=
LocateUri
(
UriPluginKind
::
STORAGE
,
uri
,
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
@@ -219,7 +219,7 @@ handle_lsinfo(Client &client, Request args, Response &r)
...
@@ -219,7 +219,7 @@ handle_lsinfo(Client &client, Request args, Response &r)
compatibility, work around this here */
compatibility, work around this here */
uri
=
""
;
uri
=
""
;
const
auto
located_uri
=
LocateUri
(
uri
,
&
client
const
auto
located_uri
=
LocateUri
(
UriPluginKind
::
INPUT
,
uri
,
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
...
src/command/PlaylistCommands.cxx
View file @
ccc58f2a
...
@@ -70,7 +70,8 @@ handle_save(Client &client, Request args, gcc_unused Response &r)
...
@@ -70,7 +70,8 @@ handle_save(Client &client, Request args, gcc_unused Response &r)
CommandResult
CommandResult
handle_load
(
Client
&
client
,
Request
args
,
gcc_unused
Response
&
r
)
handle_load
(
Client
&
client
,
Request
args
,
gcc_unused
Response
&
r
)
{
{
const
auto
uri
=
LocateUri
(
args
.
front
(),
&
client
const
auto
uri
=
LocateUri
(
UriPluginKind
::
PLAYLIST
,
args
.
front
(),
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
@@ -100,7 +101,8 @@ handle_load(Client &client, Request args, gcc_unused Response &r)
...
@@ -100,7 +101,8 @@ handle_load(Client &client, Request args, gcc_unused Response &r)
CommandResult
CommandResult
handle_listplaylist
(
Client
&
client
,
Request
args
,
Response
&
r
)
handle_listplaylist
(
Client
&
client
,
Request
args
,
Response
&
r
)
{
{
const
auto
name
=
LocateUri
(
args
.
front
(),
&
client
const
auto
name
=
LocateUri
(
UriPluginKind
::
PLAYLIST
,
args
.
front
(),
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
@@ -116,7 +118,8 @@ handle_listplaylist(Client &client, Request args, Response &r)
...
@@ -116,7 +118,8 @@ handle_listplaylist(Client &client, Request args, Response &r)
CommandResult
CommandResult
handle_listplaylistinfo
(
Client
&
client
,
Request
args
,
Response
&
r
)
handle_listplaylistinfo
(
Client
&
client
,
Request
args
,
Response
&
r
)
{
{
const
auto
name
=
LocateUri
(
args
.
front
(),
&
client
const
auto
name
=
LocateUri
(
UriPluginKind
::
PLAYLIST
,
args
.
front
(),
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
...
src/command/QueueCommands.cxx
View file @
ccc58f2a
...
@@ -83,7 +83,8 @@ handle_add(Client &client, Request args, Response &r)
...
@@ -83,7 +83,8 @@ handle_add(Client &client, Request args, Response &r)
here */
here */
uri
=
""
;
uri
=
""
;
const
auto
located_uri
=
LocateUri
(
uri
,
&
client
const
auto
located_uri
=
LocateUri
(
UriPluginKind
::
INPUT
,
uri
,
&
client
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
,
nullptr
,
nullptr
#endif
#endif
...
...
src/db/meson.build
View file @
ccc58f2a
...
@@ -9,6 +9,11 @@ db_api_dep = declare_dependency(
...
@@ -9,6 +9,11 @@ db_api_dep = declare_dependency(
link_with: db_api,
link_with: db_api,
)
)
if not enable_database
db_glue_dep = db_api_dep
subdir_done()
endif
subdir('plugins')
subdir('plugins')
db_glue_sources = [
db_glue_sources = [
...
...
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