Commit b30a510b authored by Max Kellermann's avatar Max Kellermann

Merge tag 'v0.20.18'

release v0.20.18
parents 9f6af4f2 0ebeaa9a
...@@ -527,6 +527,7 @@ libthread_a_SOURCES = \ ...@@ -527,6 +527,7 @@ libthread_a_SOURCES = \
libnet_a_SOURCES = \ libnet_a_SOURCES = \
src/net/Features.hxx \ src/net/Features.hxx \
src/net/Init.hxx \
src/net/ToString.cxx src/net/ToString.hxx \ src/net/ToString.cxx src/net/ToString.hxx \
src/net/Resolver.cxx src/net/Resolver.hxx \ src/net/Resolver.cxx src/net/Resolver.hxx \
src/net/StaticSocketAddress.cxx src/net/StaticSocketAddress.hxx \ src/net/StaticSocketAddress.cxx src/net/StaticSocketAddress.hxx \
......
...@@ -26,10 +26,14 @@ ver 0.21 (not yet released) ...@@ -26,10 +26,14 @@ ver 0.21 (not yet released)
- sndio: new mixer plugin - sndio: new mixer plugin
* require GCC 5.0 * require GCC 5.0
ver 0.20.18 (not yet released) ver 0.20.18 (2018/02/24)
* input
- curl: allow authentication methods other than "Basic"
* decoder * decoder
- flac: improve seeking precision - flac: improve seeking precision
* fix gapless CUE song transitions * fix gapless CUE song transitions
* Android, Windows
- enable the NFS storage plugin
ver 0.20.17 (2018/02/11) ver 0.20.17 (2018/02/11)
* output * output
......
...@@ -124,9 +124,9 @@ thirdparty_libs = [ ...@@ -124,9 +124,9 @@ thirdparty_libs = [
opus, opus,
flac, flac,
libid3tag, libid3tag,
libmad,
ffmpeg, ffmpeg,
curl, curl,
libnfs,
boost, boost,
] ]
......
...@@ -5,6 +5,7 @@ from build.makeproject import MakeProject ...@@ -5,6 +5,7 @@ from build.makeproject import MakeProject
class AutotoolsProject(MakeProject): class AutotoolsProject(MakeProject):
def __init__(self, url, md5, installed, configure_args=[], def __init__(self, url, md5, installed, configure_args=[],
autogen=False, autogen=False,
autoreconf=False,
cppflags='', cppflags='',
ldflags='', ldflags='',
libs='', libs='',
...@@ -13,6 +14,7 @@ class AutotoolsProject(MakeProject): ...@@ -13,6 +14,7 @@ class AutotoolsProject(MakeProject):
MakeProject.__init__(self, url, md5, installed, **kwargs) MakeProject.__init__(self, url, md5, installed, **kwargs)
self.configure_args = configure_args self.configure_args = configure_args
self.autogen = autogen self.autogen = autogen
self.autoreconf = autoreconf
self.cppflags = cppflags self.cppflags = cppflags
self.ldflags = ldflags self.ldflags = ldflags
self.libs = libs self.libs = libs
...@@ -28,6 +30,8 @@ class AutotoolsProject(MakeProject): ...@@ -28,6 +30,8 @@ class AutotoolsProject(MakeProject):
subprocess.check_call(['aclocal'], cwd=src) subprocess.check_call(['aclocal'], cwd=src)
subprocess.check_call(['automake', '--add-missing', '--force-missing', '--foreign'], cwd=src) subprocess.check_call(['automake', '--add-missing', '--force-missing', '--foreign'], cwd=src)
subprocess.check_call(['autoconf'], cwd=src) subprocess.check_call(['autoconf'], cwd=src)
if self.autoreconf:
subprocess.check_call(['autoreconf', '-vif'], cwd=src)
build = self.make_build_path(toolchain) build = self.make_build_path(toolchain)
......
...@@ -100,8 +100,8 @@ liblame = AutotoolsProject( ...@@ -100,8 +100,8 @@ liblame = AutotoolsProject(
) )
ffmpeg = FfmpegProject( ffmpeg = FfmpegProject(
'http://ffmpeg.org/releases/ffmpeg-3.4.1.tar.xz', 'http://ffmpeg.org/releases/ffmpeg-3.4.2.tar.xz',
'5a77278a63741efa74e26bf197b9bb09ac6381b9757391b922407210f0f991c0', '2b92e9578ef8b3e49eeab229e69305f5f4cbc1fdaa22e927fc7fca18acccd740',
'lib/libavcodec.a', 'lib/libavcodec.a',
[ [
'--disable-shared', '--enable-static', '--disable-shared', '--enable-static',
...@@ -124,7 +124,6 @@ ffmpeg = FfmpegProject( ...@@ -124,7 +124,6 @@ ffmpeg = FfmpegProject(
'--disable-protocols', '--disable-protocols',
'--disable-devices', '--disable-devices',
'--disable-filters', '--disable-filters',
'--disable-filters',
'--disable-v4l2_m2m', '--disable-v4l2_m2m',
'--disable-parser=bmp', '--disable-parser=bmp',
...@@ -142,7 +141,6 @@ ffmpeg = FfmpegProject( ...@@ -142,7 +141,6 @@ ffmpeg = FfmpegProject(
'--disable-parser=mjpeg', '--disable-parser=mjpeg',
'--disable-parser=mlp', '--disable-parser=mlp',
'--disable-parser=mpeg4video', '--disable-parser=mpeg4video',
'--disable-parser=mpegaudio',
'--disable-parser=mpegvideo', '--disable-parser=mpegvideo',
'--disable-parser=opus', '--disable-parser=opus',
'--disable-parser=vc1', '--disable-parser=vc1',
...@@ -194,16 +192,6 @@ ffmpeg = FfmpegProject( ...@@ -194,16 +192,6 @@ ffmpeg = FfmpegProject(
# we don't need these decoders, because we have the dedicated # we don't need these decoders, because we have the dedicated
# libraries # libraries
'--disable-decoder=flac', '--disable-decoder=flac',
'--disable-decoder=mp1',
'--disable-decoder=mp1float',
'--disable-decoder=mp2',
'--disable-decoder=mp2float',
'--disable-decoder=mp3',
'--disable-decoder=mp3adu',
'--disable-decoder=mp3adufloat',
'--disable-decoder=mp3float',
'--disable-decoder=mp3on4',
'--disable-decoder=mp3on4float',
'--disable-decoder=opus', '--disable-decoder=opus',
'--disable-decoder=vorbis', '--disable-decoder=vorbis',
...@@ -317,7 +305,7 @@ ffmpeg = FfmpegProject( ...@@ -317,7 +305,7 @@ ffmpeg = FfmpegProject(
'--disable-decoder=svq1', '--disable-decoder=svq1',
'--disable-decoder=svq3', '--disable-decoder=svq3',
'--disable-decoder=tiff', '--disable-decoder=tiff',
'--disable-decoder=mottiertexseqvideo', '--disable-decoder=tiertexseqvideo',
'--disable-decoder=truemotion1', '--disable-decoder=truemotion1',
'--disable-decoder=truemotion2', '--disable-decoder=truemotion2',
'--disable-decoder=truemotion2rt', '--disable-decoder=truemotion2rt',
...@@ -364,6 +352,21 @@ curl = AutotoolsProject( ...@@ -364,6 +352,21 @@ curl = AutotoolsProject(
patches='src/lib/curl/patches', patches='src/lib/curl/patches',
) )
libnfs = AutotoolsProject(
'https://github.com/sahlberg/libnfs/archive/libnfs-2.0.0.tar.gz',
'7ea6cd8fa6c461d01091e584d424d28e137d23ff4b65b95d01a3fd0ef95d120e',
'lib/libnfs.a',
[
'--disable-shared', '--enable-static',
'--disable-debug',
# work around -Wtautological-compare
'--disable-werror',
],
base='libnfs-libnfs-2.0.0',
autoreconf=True,
)
boost = BoostProject( boost = BoostProject(
'http://downloads.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.bz2', 'http://downloads.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.bz2',
'5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9', '5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9',
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "unix/SignalHandlers.hxx" #include "unix/SignalHandlers.hxx"
#include "system/FatalError.hxx" #include "system/FatalError.hxx"
#include "thread/Slack.hxx" #include "thread/Slack.hxx"
#include "net/Init.hxx"
#include "lib/icu/Init.hxx" #include "lib/icu/Init.hxx"
#include "config/ConfigGlobal.hxx" #include "config/ConfigGlobal.hxx"
#include "config/Param.hxx" #include "config/Param.hxx"
...@@ -106,11 +107,6 @@ ...@@ -106,11 +107,6 @@
#include <locale.h> #include <locale.h>
#endif #endif
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#ifdef __BLOCKS__ #ifdef __BLOCKS__
#include <dispatch/dispatch.h> #include <dispatch/dispatch.h>
#endif #endif
...@@ -287,25 +283,6 @@ glue_state_file_init() ...@@ -287,25 +283,6 @@ glue_state_file_init()
} }
/** /**
* Windows-only initialization of the Winsock2 library.
*/
static void winsock_init(void)
{
#ifdef _WIN32
WSADATA sockinfo;
int retval = WSAStartup(MAKEWORD(2, 2), &sockinfo);
if(retval != 0)
FormatFatalError("Attempt to open Winsock2 failed; error code %d",
retval);
if (LOBYTE(sockinfo.wVersion) != 2)
FatalError("We use Winsock2 but your version is either too new "
"or old; please install Winsock 2.x");
#endif
}
/**
* Initialize the decoder and player core, including the music pipe. * Initialize the decoder and player core, including the music pipe.
*/ */
static void static void
...@@ -504,7 +481,8 @@ try { ...@@ -504,7 +481,8 @@ try {
IcuInit(); IcuInit();
winsock_init(); const ScopeNetInit net_init;
config_global_init(); config_global_init();
#ifdef ANDROID #ifdef ANDROID
...@@ -749,10 +727,6 @@ try { ...@@ -749,10 +727,6 @@ try {
daemonize_finish(); daemonize_finish();
#endif #endif
#ifdef _WIN32
WSACleanup();
#endif
IcuFinish(); IcuFinish();
log_deinit(); log_deinit();
......
...@@ -64,6 +64,7 @@ CurlRequest::CurlRequest(CurlGlobal &_global, ...@@ -64,6 +64,7 @@ CurlRequest::CurlRequest(CurlGlobal &_global,
easy.SetOption(CURLOPT_NOPROGRESS, 1l); easy.SetOption(CURLOPT_NOPROGRESS, 1l);
easy.SetOption(CURLOPT_NOSIGNAL, 1l); easy.SetOption(CURLOPT_NOSIGNAL, 1l);
easy.SetOption(CURLOPT_CONNECTTIMEOUT, 10l); easy.SetOption(CURLOPT_CONNECTTIMEOUT, 10l);
easy.SetOption(CURLOPT_HTTPAUTH, (long) CURLAUTH_ANY);
} }
CurlRequest::~CurlRequest() noexcept CurlRequest::~CurlRequest() noexcept
......
...@@ -31,7 +31,11 @@ extern "C" { ...@@ -31,7 +31,11 @@ extern "C" {
#include <utility> #include <utility>
#ifdef _WIN32
#include <winsock2.h>
#else
#include <poll.h> /* for POLLIN, POLLOUT */ #include <poll.h> /* for POLLIN, POLLOUT */
#endif
static constexpr std::chrono::steady_clock::duration NFS_MOUNT_TIMEOUT = static constexpr std::chrono::steady_clock::duration NFS_MOUNT_TIMEOUT =
std::chrono::minutes(1); std::chrono::minutes(1);
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h>
NfsFileReader::NfsFileReader() noexcept NfsFileReader::NfsFileReader() noexcept
:defer_open(nfs_get_event_loop(), BIND_THIS_METHOD(OnDeferredOpen)) :defer_open(nfs_get_event_loop(), BIND_THIS_METHOD(OnDeferredOpen))
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <sys/stat.h>
struct nfsfh; struct nfsfh;
class NfsConnection; class NfsConnection;
......
/*
* Copyright 2003-2017 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 NET_INIT_HXX
#define NET_INIT_HXX
#include "check.h"
#include "SocketError.hxx"
#ifdef _WIN32
#include <winsock2.h>
#endif
class ScopeNetInit {
#ifdef _WIN32
public:
ScopeNetInit() {
WSADATA sockinfo;
int retval = WSAStartup(MAKEWORD(2, 2), &sockinfo);
if (retval != 0)
throw MakeSocketError(retval, "WSAStartup() failed");
}
~ScopeNetInit() noexcept {
WSACleanup();
}
#endif
};
#endif
...@@ -229,6 +229,7 @@ CueParser::Feed2(char *p) noexcept ...@@ -229,6 +229,7 @@ CueParser::Feed2(char *p) noexcept
} }
state = TRACK; state = TRACK;
ignore_index = false;
current = std::make_unique<DetachedSong>(filename); current = std::make_unique<DetachedSong>(filename);
assert(!current->GetTag().IsDefined()); assert(!current->GetTag().IsDefined());
...@@ -238,6 +239,9 @@ CueParser::Feed2(char *p) noexcept ...@@ -238,6 +239,9 @@ CueParser::Feed2(char *p) noexcept
} else if (state == IGNORE_TRACK) { } else if (state == IGNORE_TRACK) {
return; return;
} else if (state == TRACK && strcmp(command, "INDEX") == 0) { } else if (state == TRACK && strcmp(command, "INDEX") == 0) {
if (ignore_index)
return;
const char *nr = cue_next_token(&p); const char *nr = cue_next_token(&p);
if (nr == nullptr) if (nr == nullptr)
return; return;
...@@ -255,7 +259,7 @@ CueParser::Feed2(char *p) noexcept ...@@ -255,7 +259,7 @@ CueParser::Feed2(char *p) noexcept
current->SetStartTime(SongTime::FromMS(position_ms)); current->SetStartTime(SongTime::FromMS(position_ms));
if(strcmp(nr, "00") != 0 || previous == nullptr) if(strcmp(nr, "00") != 0 || previous == nullptr)
state = IGNORE_TRACK; ignore_index = true;
} }
} }
......
...@@ -88,6 +88,13 @@ class CueParser { ...@@ -88,6 +88,13 @@ class CueParser {
std::unique_ptr<DetachedSong> finished; std::unique_ptr<DetachedSong> finished;
/** /**
* Ignore "INDEX" lines? Only up the first one after "00" is
* used. If there is a pregap (INDEX 00..01), it is assigned
* to the previous song.
*/
bool ignore_index;
/**
* Tracks whether Finish() has been called. If true, then all * Tracks whether Finish() has been called. If true, then all
* remaining (partial) results will be delivered by Get(). * remaining (partial) results will be delivered by Get().
*/ */
......
...@@ -222,7 +222,12 @@ UriToNfsPath(const char *_uri_utf8) ...@@ -222,7 +222,12 @@ UriToNfsPath(const char *_uri_utf8)
std::string uri_utf8("/"); std::string uri_utf8("/");
uri_utf8.append(_uri_utf8); uri_utf8.append(_uri_utf8);
#ifdef _WIN32
/* assume UTF-8 when accessing NFS from Windows */
return uri_utf8;
#else
return AllocatedPath::FromUTF8Throw(uri_utf8.c_str()).Steal(); return AllocatedPath::FromUTF8Throw(uri_utf8.c_str()).Steal();
#endif
} }
std::string std::string
...@@ -294,7 +299,7 @@ NfsStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow) ...@@ -294,7 +299,7 @@ NfsStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow)
gcc_pure gcc_pure
static bool static bool
SkipNameFS(const char *name) noexcept SkipNameFS(PathTraitsFS::const_pointer_type name) noexcept
{ {
return name[0] == '.' && return name[0] == '.' &&
(name[1] == 0 || (name[1] == 0 ||
...@@ -362,7 +367,14 @@ NfsListDirectoryOperation::CollectEntries(struct nfsdir *dir) ...@@ -362,7 +367,14 @@ NfsListDirectoryOperation::CollectEntries(struct nfsdir *dir)
const struct nfsdirent *ent; const struct nfsdirent *ent;
while ((ent = connection.ReadDirectory(dir)) != nullptr) { while ((ent = connection.ReadDirectory(dir)) != nullptr) {
#ifdef _WIN32
/* assume UTF-8 when accessing NFS from Windows */
const auto name_fs = AllocatedPath::FromUTF8Throw(ent->name);
if (name_fs.IsNull())
continue;
#else
const Path name_fs = Path::FromFS(ent->name); const Path name_fs = Path::FromFS(ent->name);
#endif
if (SkipNameFS(name_fs.c_str())) if (SkipNameFS(name_fs.c_str()))
continue; continue;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "storage/Registry.hxx" #include "storage/Registry.hxx"
#include "storage/StorageInterface.hxx" #include "storage/StorageInterface.hxx"
#include "storage/FileInfo.hxx" #include "storage/FileInfo.hxx"
#include "net/Init.hxx"
#include "util/ChronoUtil.hxx" #include "util/ChronoUtil.hxx"
#include <memory> #include <memory>
...@@ -72,7 +73,12 @@ Ls(Storage &storage, const char *path) ...@@ -72,7 +73,12 @@ Ls(Storage &storage, const char *path)
const char *mtime = " "; const char *mtime = " ";
if (!IsNegative(info.mtime)) { if (!IsNegative(info.mtime)) {
time_t t = std::chrono::system_clock::to_time_t(info.mtime); time_t t = std::chrono::system_clock::to_time_t(info.mtime);
strftime(mtime_buffer, sizeof(mtime_buffer), "%F", strftime(mtime_buffer, sizeof(mtime_buffer),
#ifdef _WIN32
"%Y-%m-%d",
#else
"%F",
#endif
gmtime(&t)); gmtime(&t));
mtime = mtime_buffer; mtime = mtime_buffer;
} }
...@@ -96,6 +102,7 @@ try { ...@@ -96,6 +102,7 @@ try {
const char *const command = argv[1]; const char *const command = argv[1];
const char *const storage_uri = argv[2]; const char *const storage_uri = argv[2];
const ScopeNetInit net_init;
EventThread io_thread; EventThread io_thread;
io_thread.Start(); io_thread.Start();
......
...@@ -58,7 +58,8 @@ class CrossGccToolchain: ...@@ -58,7 +58,8 @@ class CrossGccToolchain:
self.cflags = common_flags self.cflags = common_flags
self.cxxflags = common_flags self.cxxflags = common_flags
self.cppflags = '-isystem ' + os.path.join(install_prefix, 'include') self.cppflags = '-isystem ' + os.path.join(install_prefix, 'include') + \
' -DWINVER=0x0600 -D_WIN32_WINNT=0x0600'
self.ldflags = '-L' + os.path.join(install_prefix, 'lib') self.ldflags = '-L' + os.path.join(install_prefix, 'lib')
self.libs = '' self.libs = ''
...@@ -84,6 +85,7 @@ thirdparty_libs = [ ...@@ -84,6 +85,7 @@ thirdparty_libs = [
liblame, liblame,
ffmpeg, ffmpeg,
curl, curl,
libnfs,
boost, boost,
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment