From 362e73bea88c8bf4a59e16939da615bf5ddf0558 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Nov 2014 13:56:34 +0100 Subject: input/Open: expose input_domain --- src/input/Domain.cxx | 24 ++++++++++++++++++++++++ src/input/Domain.hxx | 27 +++++++++++++++++++++++++++ src/input/Open.cxx | 3 +-- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 src/input/Domain.cxx create mode 100644 src/input/Domain.hxx (limited to 'src') diff --git a/src/input/Domain.cxx b/src/input/Domain.cxx new file mode 100644 index 000000000..26ae298a4 --- /dev/null +++ b/src/input/Domain.cxx @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2003-2014 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" +#include "Domain.hxx" +#include "util/Domain.hxx" + +const Domain input_domain("input"); diff --git a/src/input/Domain.hxx b/src/input/Domain.hxx new file mode 100644 index 000000000..16fa5e0f1 --- /dev/null +++ b/src/input/Domain.hxx @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2003-2014 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPD_INPUT_DOMAIN_HXX +#define MPD_INPUT_DOMAIN_HXX + +class Domain; + +extern const Domain input_domain; + +#endif diff --git a/src/input/Open.cxx b/src/input/Open.cxx index 18572d6b2..66ccdce74 100644 --- a/src/input/Open.cxx +++ b/src/input/Open.cxx @@ -22,14 +22,13 @@ #include "Registry.hxx" #include "InputPlugin.hxx" #include "LocalOpen.hxx" +#include "Domain.hxx" #include "plugins/RewindInputPlugin.hxx" #include "fs/Traits.hxx" #include "fs/Path.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" -static constexpr Domain input_domain("input"); - InputStream * InputStream::Open(const char *url, Mutex &mutex, Cond &cond, -- cgit v1.2.3 From 1bd8a322f52c3094b8d343f249f54b75a97bd598 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Nov 2014 13:55:23 +0100 Subject: input/AsyncInputStream: set Error when seeking unseekable Fixes crash in the "audiofile" decoder while logging the seek error. --- src/input/AsyncInputStream.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx index d34ba2ff3..c8e3fcfd5 100644 --- a/src/input/AsyncInputStream.cxx +++ b/src/input/AsyncInputStream.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "AsyncInputStream.hxx" +#include "Domain.hxx" #include "tag/Tag.hxx" #include "event/Call.hxx" #include "thread/Cond.hxx" @@ -113,8 +114,10 @@ AsyncInputStream::Seek(offset_type new_offset, Error &error) /* no-op */ return true; - if (!IsSeekable()) + if (!IsSeekable()) { + error.Set(input_domain, "Not seekable"); return false; + } /* check if we can fast-forward the buffer */ -- cgit v1.2.3 From 6f23e91e335b3415080fcbc90cb9fc3cdcc4344f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Nov 2014 18:42:51 +0100 Subject: lib/upnp/ContentDirectoryService: swap uri_apply_base() parameters When uri_apply_base() was moved from db/upnp/Util.cpp to util/UriUtil.cpp, the parameter order was changed, however without swapping the parameters in the ContentDirectoryService constructor. --- src/lib/upnp/ContentDirectoryService.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/upnp/ContentDirectoryService.cxx b/src/lib/upnp/ContentDirectoryService.cxx index ee7c0d7f5..0e5d2d955 100644 --- a/src/lib/upnp/ContentDirectoryService.cxx +++ b/src/lib/upnp/ContentDirectoryService.cxx @@ -29,7 +29,7 @@ ContentDirectoryService::ContentDirectoryService(const UPnPDevice &device, const UPnPService &service) - :m_actionURL(uri_apply_base(device.URLBase, service.controlURL)), + :m_actionURL(uri_apply_base(service.controlURL, device.URLBase)), m_serviceType(service.serviceType), m_deviceId(device.UDN), m_friendlyName(device.friendlyName), -- cgit v1.2.3 From ccb13205f4920b3bd5e8c52f5ec587cf1adf375f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Nov 2014 19:12:43 +0100 Subject: db/upnp: fix valgrind warning --- src/db/plugins/upnp/Directory.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/db/plugins/upnp/Directory.cxx b/src/db/plugins/upnp/Directory.cxx index 683022a10..e94a1a997 100644 --- a/src/db/plugins/upnp/Directory.cxx +++ b/src/db/plugins/upnp/Directory.cxx @@ -129,6 +129,7 @@ public: state(NONE), tag_type(TAG_NUM_OF_ITEM_TYPES) { + m_tobj.clear(); } protected: -- cgit v1.2.3 From 125eb01e03082f1c33fa1b0b6d51b953eebf6c28 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Nov 2014 19:22:26 +0100 Subject: decoder/ffmpeg: support opus --- src/decoder/plugins/FfmpegDecoderPlugin.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 2e72269b2..466caa3d1 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -657,7 +657,7 @@ static const char *const ffmpeg_suffixes[] = { "mj2", "mjpeg", "mjpg", "mka", "mkv", "mlp", "mm", "mmf", "mov", "mp+", "mp1", "mp2", "mp3", "mp4", "mpc", "mpeg", "mpg", "mpga", "mpp", "mpu", "mve", "mvi", "mxf", "nc", "nsv", "nut", "nuv", "oga", "ogm", "ogv", - "ogx", "oma", "ogg", "omg", "psp", "pva", "qcp", "qt", "r3d", "ra", + "ogx", "oma", "ogg", "omg", "opus", "psp", "pva", "qcp", "qt", "r3d", "ra", "ram", "rl2", "rm", "rmvb", "roq", "rpl", "rvc", "shn", "smk", "snd", "sol", "son", "spx", "str", "swf", "tgi", "tgq", "tgv", "thp", "ts", "tsp", "tta", "xa", "xvid", "uv", "uv2", "vb", "vid", "vob", "voc", @@ -691,6 +691,7 @@ static const char *const ffmpeg_mime_types[] = { "audio/mpeg", "audio/musepack", "audio/ogg", + "audio/opus", "audio/qcelp", "audio/vorbis", "audio/vorbis+ogg", -- cgit v1.2.3