Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0ebeaa9ac2 | ||
![]() |
25cd47b8dc | ||
![]() |
cd48d981b5 | ||
![]() |
774d26b982 | ||
![]() |
f3e683bd6f | ||
![]() |
50ce0c0d9d | ||
![]() |
5b80711d75 | ||
![]() |
666e456551 | ||
![]() |
31794ac376 | ||
![]() |
2141fdf06e | ||
![]() |
3f3e0739c4 | ||
![]() |
ebed7e2147 | ||
![]() |
53f5d4c710 | ||
![]() |
139a4054c5 | ||
![]() |
a4de96508d | ||
![]() |
a7582aaf15 | ||
![]() |
c5c1c64a81 | ||
![]() |
992c52ce7f | ||
![]() |
026aef7465 | ||
![]() |
b53a23b51b | ||
![]() |
2aad015392 | ||
![]() |
986ec877b0 | ||
![]() |
c43ea74b30 | ||
![]() |
79981f3cda |
Makefile.amNEWS
android
configure.acpython/build
src
test
win32
@@ -497,6 +497,7 @@ libthread_a_SOURCES = \
|
||||
|
||||
libnet_a_SOURCES = \
|
||||
src/net/Features.hxx \
|
||||
src/net/Init.hxx \
|
||||
src/net/ToString.cxx src/net/ToString.hxx \
|
||||
src/net/Resolver.cxx src/net/Resolver.hxx \
|
||||
src/net/StaticSocketAddress.cxx src/net/StaticSocketAddress.hxx \
|
||||
|
9
NEWS
9
NEWS
@@ -1,3 +1,12 @@
|
||||
ver 0.20.18 (2018/02/24)
|
||||
* input
|
||||
- curl: allow authentication methods other than "Basic"
|
||||
* decoder
|
||||
- flac: improve seeking precision
|
||||
* fix gapless CUE song transitions
|
||||
* Android, Windows
|
||||
- enable the NFS storage plugin
|
||||
|
||||
ver 0.20.17 (2018/02/11)
|
||||
* output
|
||||
- alsa: fix crash bug with 8 channels
|
||||
|
@@ -2,8 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.musicpd"
|
||||
android:installLocation="auto"
|
||||
android:versionCode="16"
|
||||
android:versionName="0.20.17">
|
||||
android:versionCode="17"
|
||||
android:versionName="0.20.18">
|
||||
|
||||
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17"/>
|
||||
|
||||
|
@@ -124,9 +124,9 @@ thirdparty_libs = [
|
||||
opus,
|
||||
flac,
|
||||
libid3tag,
|
||||
libmad,
|
||||
ffmpeg,
|
||||
curl,
|
||||
libnfs,
|
||||
boost,
|
||||
]
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
AC_INIT(mpd, 0.20.17, musicpd-dev-team@lists.sourceforge.net)
|
||||
AC_INIT(mpd, 0.20.18, musicpd-dev-team@lists.sourceforge.net)
|
||||
|
||||
VERSION_MAJOR=0
|
||||
VERSION_MINOR=20
|
||||
VERSION_REVISION=17
|
||||
VERSION_REVISION=18
|
||||
VERSION_EXTRA=0
|
||||
|
||||
AC_CONFIG_SRCDIR([src/Main.cxx])
|
||||
|
@@ -5,6 +5,7 @@ from build.makeproject import MakeProject
|
||||
class AutotoolsProject(MakeProject):
|
||||
def __init__(self, url, md5, installed, configure_args=[],
|
||||
autogen=False,
|
||||
autoreconf=False,
|
||||
cppflags='',
|
||||
ldflags='',
|
||||
libs='',
|
||||
@@ -13,6 +14,7 @@ class AutotoolsProject(MakeProject):
|
||||
MakeProject.__init__(self, url, md5, installed, **kwargs)
|
||||
self.configure_args = configure_args
|
||||
self.autogen = autogen
|
||||
self.autoreconf = autoreconf
|
||||
self.cppflags = cppflags
|
||||
self.ldflags = ldflags
|
||||
self.libs = libs
|
||||
@@ -28,6 +30,8 @@ class AutotoolsProject(MakeProject):
|
||||
subprocess.check_call(['aclocal'], cwd=src)
|
||||
subprocess.check_call(['automake', '--add-missing', '--force-missing', '--foreign'], cwd=src)
|
||||
subprocess.check_call(['autoconf'], cwd=src)
|
||||
if self.autoreconf:
|
||||
subprocess.check_call(['autoreconf', '-vif'], cwd=src)
|
||||
|
||||
build = self.make_build_path(toolchain)
|
||||
|
||||
|
@@ -100,8 +100,8 @@ liblame = AutotoolsProject(
|
||||
)
|
||||
|
||||
ffmpeg = FfmpegProject(
|
||||
'http://ffmpeg.org/releases/ffmpeg-3.4.1.tar.xz',
|
||||
'5a77278a63741efa74e26bf197b9bb09ac6381b9757391b922407210f0f991c0',
|
||||
'http://ffmpeg.org/releases/ffmpeg-3.4.2.tar.xz',
|
||||
'2b92e9578ef8b3e49eeab229e69305f5f4cbc1fdaa22e927fc7fca18acccd740',
|
||||
'lib/libavcodec.a',
|
||||
[
|
||||
'--disable-shared', '--enable-static',
|
||||
@@ -124,7 +124,6 @@ ffmpeg = FfmpegProject(
|
||||
'--disable-protocols',
|
||||
'--disable-devices',
|
||||
'--disable-filters',
|
||||
'--disable-filters',
|
||||
'--disable-v4l2_m2m',
|
||||
|
||||
'--disable-parser=bmp',
|
||||
@@ -142,7 +141,6 @@ ffmpeg = FfmpegProject(
|
||||
'--disable-parser=mjpeg',
|
||||
'--disable-parser=mlp',
|
||||
'--disable-parser=mpeg4video',
|
||||
'--disable-parser=mpegaudio',
|
||||
'--disable-parser=mpegvideo',
|
||||
'--disable-parser=opus',
|
||||
'--disable-parser=vc1',
|
||||
@@ -194,16 +192,6 @@ ffmpeg = FfmpegProject(
|
||||
# we don't need these decoders, because we have the dedicated
|
||||
# libraries
|
||||
'--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=vorbis',
|
||||
|
||||
@@ -317,7 +305,7 @@ ffmpeg = FfmpegProject(
|
||||
'--disable-decoder=svq1',
|
||||
'--disable-decoder=svq3',
|
||||
'--disable-decoder=tiff',
|
||||
'--disable-decoder=mottiertexseqvideo',
|
||||
'--disable-decoder=tiertexseqvideo',
|
||||
'--disable-decoder=truemotion1',
|
||||
'--disable-decoder=truemotion2',
|
||||
'--disable-decoder=truemotion2rt',
|
||||
@@ -364,6 +352,21 @@ curl = AutotoolsProject(
|
||||
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(
|
||||
'http://downloads.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.bz2',
|
||||
'5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9',
|
||||
|
32
src/Main.cxx
32
src/Main.cxx
@@ -50,6 +50,7 @@
|
||||
#include "unix/SignalHandlers.hxx"
|
||||
#include "system/FatalError.hxx"
|
||||
#include "thread/Slack.hxx"
|
||||
#include "net/Init.hxx"
|
||||
#include "lib/icu/Init.hxx"
|
||||
#include "config/ConfigGlobal.hxx"
|
||||
#include "config/Param.hxx"
|
||||
@@ -106,11 +107,6 @@
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
#ifdef __BLOCKS__
|
||||
#include <dispatch/dispatch.h>
|
||||
#endif
|
||||
@@ -284,25 +280,6 @@ glue_state_file_init()
|
||||
instance->state_file->Read();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@@ -451,7 +428,8 @@ try {
|
||||
|
||||
IcuInit();
|
||||
|
||||
winsock_init();
|
||||
const ScopeNetInit net_init;
|
||||
|
||||
io_thread_init();
|
||||
config_global_init();
|
||||
|
||||
@@ -702,10 +680,6 @@ try {
|
||||
daemonize_finish();
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
||||
IcuFinish();
|
||||
|
||||
log_deinit();
|
||||
|
@@ -300,6 +300,7 @@ DecoderBridge::CommandFinished()
|
||||
|
||||
initial_seek_running = false;
|
||||
timestamp = dc.start_time.ToDoubleS();
|
||||
absolute_frame = dc.start_time.ToScale<uint64_t>(dc.in_audio_format.sample_rate);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -319,6 +320,7 @@ DecoderBridge::CommandFinished()
|
||||
convert->Reset();
|
||||
|
||||
timestamp = dc.seek_time.ToDoubleS();
|
||||
absolute_frame = dc.seek_time.ToScale<uint64_t>(dc.in_audio_format.sample_rate);
|
||||
}
|
||||
|
||||
dc.command = DecoderCommand::NONE;
|
||||
@@ -427,6 +429,7 @@ DecoderBridge::SubmitTimestamp(double t)
|
||||
assert(t >= 0);
|
||||
|
||||
timestamp = t;
|
||||
absolute_frame = uint64_t(t * dc.in_audio_format.sample_rate);
|
||||
}
|
||||
|
||||
DecoderCommand
|
||||
@@ -464,6 +467,29 @@ DecoderBridge::SubmitData(InputStream *is,
|
||||
return cmd;
|
||||
}
|
||||
|
||||
cmd = DecoderCommand::NONE;
|
||||
|
||||
const size_t frame_size = dc.in_audio_format.GetFrameSize();
|
||||
size_t data_frames = length / frame_size;
|
||||
|
||||
if (dc.end_time.IsPositive()) {
|
||||
/* enforce the given end time */
|
||||
|
||||
const uint64_t end_frame =
|
||||
dc.end_time.ToScale<uint64_t>(dc.in_audio_format.sample_rate);
|
||||
if (absolute_frame >= end_frame)
|
||||
return DecoderCommand::STOP;
|
||||
|
||||
const uint64_t remaining_frames = end_frame - absolute_frame;
|
||||
if (data_frames >= remaining_frames) {
|
||||
/* past the end of the range: truncate this
|
||||
data submission and stop the decoder */
|
||||
data_frames = remaining_frames;
|
||||
length = data_frames * frame_size;
|
||||
cmd = DecoderCommand::STOP;
|
||||
}
|
||||
}
|
||||
|
||||
if (convert != nullptr) {
|
||||
assert(dc.in_audio_format != dc.out_audio_format);
|
||||
|
||||
@@ -521,15 +547,11 @@ DecoderBridge::SubmitData(InputStream *is,
|
||||
|
||||
timestamp += (double)nbytes /
|
||||
dc.out_audio_format.GetTimeToSize();
|
||||
|
||||
if (dc.end_time.IsPositive() &&
|
||||
timestamp >= dc.end_time.ToDoubleS())
|
||||
/* the end of this range has been reached:
|
||||
stop decoding */
|
||||
return DecoderCommand::STOP;
|
||||
}
|
||||
|
||||
return DecoderCommand::NONE;
|
||||
absolute_frame += data_frames;
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
DecoderCommand
|
||||
|
@@ -49,6 +49,11 @@ public:
|
||||
*/
|
||||
double timestamp = 0;
|
||||
|
||||
/**
|
||||
* The time stamp of the next data chunk, in PCM frames.
|
||||
*/
|
||||
uint64_t absolute_frame = 0;
|
||||
|
||||
/**
|
||||
* Is the initial seek (to the start position of the sub-song)
|
||||
* pending, or has it been performed already?
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#include "config.h"
|
||||
#include "FlacCommon.hxx"
|
||||
#include "FlacMetadata.hxx"
|
||||
#include "util/ConstBuffer.hxx"
|
||||
#include "Log.hxx"
|
||||
|
||||
#include <stdexcept>
|
||||
@@ -143,25 +142,10 @@ FlacDecoder::OnWrite(const FLAC__Frame &frame,
|
||||
if (!initialized && !OnFirstFrame(frame.header))
|
||||
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
|
||||
|
||||
const auto data = pcm_import.Import(buf, frame.header.blocksize);
|
||||
chunk = pcm_import.Import(buf, frame.header.blocksize);
|
||||
|
||||
unsigned bit_rate = nbytes * 8 * frame.header.sample_rate /
|
||||
kbit_rate = nbytes * 8 * frame.header.sample_rate /
|
||||
(1000 * frame.header.blocksize);
|
||||
|
||||
auto cmd = GetClient()->SubmitData(GetInputStream(),
|
||||
data.data, data.size,
|
||||
bit_rate);
|
||||
switch (cmd) {
|
||||
case DecoderCommand::NONE:
|
||||
case DecoderCommand::START:
|
||||
break;
|
||||
|
||||
case DecoderCommand::STOP:
|
||||
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
|
||||
|
||||
case DecoderCommand::SEEK:
|
||||
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
|
||||
}
|
||||
|
||||
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "FlacInput.hxx"
|
||||
#include "FlacPcm.hxx"
|
||||
#include "../DecoderAPI.hxx"
|
||||
#include "util/ConstBuffer.hxx"
|
||||
|
||||
#include <FLAC/stream_decoder.h>
|
||||
|
||||
@@ -41,6 +42,12 @@ struct FlacDecoder : public FlacInput {
|
||||
*/
|
||||
bool unsupported = false;
|
||||
|
||||
/**
|
||||
* The kbit_rate parameter for the next
|
||||
* DecoderBridge::SubmitData() call.
|
||||
*/
|
||||
uint16_t kbit_rate;
|
||||
|
||||
FlacPcmImport pcm_import;
|
||||
|
||||
/**
|
||||
@@ -51,6 +58,13 @@ struct FlacDecoder : public FlacInput {
|
||||
|
||||
Tag tag;
|
||||
|
||||
/**
|
||||
* Decoded PCM data obtained by our libFLAC write callback.
|
||||
* If this is non-empty, then DecoderBridge::SubmitData()
|
||||
* should be called.
|
||||
*/
|
||||
ConstBuffer<void> chunk = nullptr;
|
||||
|
||||
FlacDecoder(DecoderClient &_client, InputStream &_input_stream)
|
||||
:FlacInput(_input_stream, &_client) {}
|
||||
|
||||
|
@@ -139,19 +139,40 @@ flac_decoder_initialize(FlacDecoder *data, FLAC__StreamDecoder *sd)
|
||||
return data->initialized;
|
||||
}
|
||||
|
||||
static DecoderCommand
|
||||
FlacSubmitToClient(DecoderClient &client, FlacDecoder &d) noexcept
|
||||
{
|
||||
if (d.tag.IsEmpty() && d.chunk.IsEmpty())
|
||||
return client.GetCommand();
|
||||
|
||||
if (!d.tag.IsEmpty()) {
|
||||
auto cmd = client.SubmitTag(d.GetInputStream(),
|
||||
std::move(d.tag));
|
||||
d.tag.Clear();
|
||||
if (cmd != DecoderCommand::NONE)
|
||||
return cmd;
|
||||
}
|
||||
|
||||
if (!d.chunk.IsEmpty()) {
|
||||
auto cmd = client.SubmitData(d.GetInputStream(),
|
||||
d.chunk.data,
|
||||
d.chunk.size,
|
||||
d.kbit_rate);
|
||||
d.chunk = nullptr;
|
||||
if (cmd != DecoderCommand::NONE)
|
||||
return cmd;
|
||||
}
|
||||
|
||||
return DecoderCommand::NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
flac_decoder_loop(FlacDecoder *data, FLAC__StreamDecoder *flac_dec)
|
||||
{
|
||||
DecoderClient &client = *data->GetClient();
|
||||
|
||||
while (true) {
|
||||
DecoderCommand cmd;
|
||||
if (!data->tag.IsEmpty()) {
|
||||
cmd = client.SubmitTag(data->GetInputStream(),
|
||||
std::move(data->tag));
|
||||
data->tag.Clear();
|
||||
} else
|
||||
cmd = client.GetCommand();
|
||||
DecoderCommand cmd = FlacSubmitToClient(client, *data);
|
||||
|
||||
if (cmd == DecoderCommand::SEEK) {
|
||||
FLAC__uint64 seek_sample = client.GetSeekFrame();
|
||||
@@ -160,6 +181,11 @@ flac_decoder_loop(FlacDecoder *data, FLAC__StreamDecoder *flac_dec)
|
||||
client.CommandFinished();
|
||||
} else
|
||||
client.SeekError();
|
||||
|
||||
/* FLAC__stream_decoder_seek_absolute()
|
||||
decodes one frame and may have provided
|
||||
data to be submitted to the client */
|
||||
continue;
|
||||
} else if (cmd == DecoderCommand::STOP)
|
||||
break;
|
||||
|
||||
|
@@ -52,7 +52,7 @@ class OpusEncoder final : public OggEncoder {
|
||||
|
||||
ogg_int64_t packetno = 0;
|
||||
|
||||
ogg_int64_t granulepos;
|
||||
ogg_int64_t granulepos = 0;
|
||||
|
||||
public:
|
||||
OpusEncoder(AudioFormat &_audio_format, ::OpusEncoder *_enc);
|
||||
|
@@ -62,6 +62,7 @@ CurlRequest::CurlRequest(CurlGlobal &_global, const char *url,
|
||||
easy.SetOption(CURLOPT_NOPROGRESS, 1l);
|
||||
easy.SetOption(CURLOPT_NOSIGNAL, 1l);
|
||||
easy.SetOption(CURLOPT_CONNECTTIMEOUT, 10l);
|
||||
easy.SetOption(CURLOPT_HTTPAUTH, (long) CURLAUTH_ANY);
|
||||
easy.SetOption(CURLOPT_URL, url);
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,11 @@ extern "C" {
|
||||
|
||||
#include <utility>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <poll.h> /* for POLLIN, POLLOUT */
|
||||
#endif
|
||||
|
||||
static constexpr std::chrono::steady_clock::duration NFS_MOUNT_TIMEOUT =
|
||||
std::chrono::minutes(1);
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
NfsFileReader::NfsFileReader()
|
||||
:DeferredMonitor(io_thread_get()), state(State::INITIAL)
|
||||
|
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
struct nfsfh;
|
||||
class NfsConnection;
|
||||
|
46
src/net/Init.hxx
Normal file
46
src/net/Init.hxx
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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,8 @@ CueParser::Feed2(char *p) noexcept
|
||||
}
|
||||
|
||||
state = TRACK;
|
||||
ignore_index = false;
|
||||
|
||||
current.reset(new DetachedSong(filename));
|
||||
assert(!current->GetTag().IsDefined());
|
||||
|
||||
@@ -238,6 +240,9 @@ CueParser::Feed2(char *p) noexcept
|
||||
} else if (state == IGNORE_TRACK) {
|
||||
return;
|
||||
} else if (state == TRACK && strcmp(command, "INDEX") == 0) {
|
||||
if (ignore_index)
|
||||
return;
|
||||
|
||||
const char *nr = cue_next_token(&p);
|
||||
if (nr == nullptr)
|
||||
return;
|
||||
@@ -255,7 +260,7 @@ CueParser::Feed2(char *p) noexcept
|
||||
|
||||
current->SetStartTime(SongTime::FromMS(position_ms));
|
||||
if(strcmp(nr, "00") != 0 || previous == nullptr)
|
||||
state = IGNORE_TRACK;
|
||||
ignore_index = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -87,6 +87,13 @@ class CueParser {
|
||||
*/
|
||||
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
|
||||
* remaining (partial) results will be delivered by Get().
|
||||
|
@@ -219,7 +219,12 @@ UriToNfsPath(const char *_uri_utf8)
|
||||
std::string 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();
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string
|
||||
@@ -291,7 +296,7 @@ NfsStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow)
|
||||
|
||||
gcc_pure
|
||||
static bool
|
||||
SkipNameFS(const char *name) noexcept
|
||||
SkipNameFS(PathTraitsFS::const_pointer_type name) noexcept
|
||||
{
|
||||
return name[0] == '.' &&
|
||||
(name[1] == 0 ||
|
||||
@@ -358,7 +363,14 @@ NfsListDirectoryOperation::CollectEntries(struct nfsdir *dir)
|
||||
|
||||
const struct nfsdirent *ent;
|
||||
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);
|
||||
#endif
|
||||
if (SkipNameFS(name_fs.c_str()))
|
||||
continue;
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "storage/Registry.hxx"
|
||||
#include "storage/StorageInterface.hxx"
|
||||
#include "storage/FileInfo.hxx"
|
||||
#include "net/Init.hxx"
|
||||
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
@@ -70,7 +71,12 @@ Ls(Storage &storage, const char *path)
|
||||
char mtime_buffer[32];
|
||||
const char *mtime = " ";
|
||||
if (info.mtime > 0) {
|
||||
strftime(mtime_buffer, sizeof(mtime_buffer), "%F",
|
||||
strftime(mtime_buffer, sizeof(mtime_buffer),
|
||||
#ifdef _WIN32
|
||||
"%Y-%m-%d",
|
||||
#else
|
||||
"%F",
|
||||
#endif
|
||||
gmtime(&info.mtime));
|
||||
mtime = mtime_buffer;
|
||||
}
|
||||
@@ -95,6 +101,7 @@ try {
|
||||
const char *const command = argv[1];
|
||||
const char *const storage_uri = argv[2];
|
||||
|
||||
const ScopeNetInit net_init;
|
||||
const ScopeIOThread io_thread;
|
||||
|
||||
if (strcmp(command, "ls") == 0) {
|
||||
|
@@ -58,7 +58,8 @@ class CrossGccToolchain:
|
||||
|
||||
self.cflags = 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.libs = ''
|
||||
|
||||
@@ -84,6 +85,7 @@ thirdparty_libs = [
|
||||
liblame,
|
||||
ffmpeg,
|
||||
curl,
|
||||
libnfs,
|
||||
boost,
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user