Commit Graph

825 Commits

Author SHA1 Message Date
Max Kellermann 2c3eb5b8ad test/TestUriRelative: new unit test 2019-09-07 23:27:24 +02:00
Max Kellermann f750c8012a test/run_filter: use Filter::Flush() 2019-08-26 21:17:31 +02:00
Max Kellermann b0a04b3da8 test/run_filter: pass ConstBuffer<void> to FullWrite() 2019-08-26 21:17:27 +02:00
Max Kellermann 9617bd6c85 test/run_filter: fix error message 2019-08-26 21:17:26 +02:00
Max Kellermann 2e9b5e4e78 filter/Registry: rename the source file 2019-08-26 20:54:52 +02:00
Max Kellermann f3ed2c0a82 time/ISO8601: support omitting seconds 2019-08-19 22:44:41 +02:00
Max Kellermann 2c35ea92bd time/ISO8601: support time zone offset 2019-08-19 22:44:28 +02:00
Max Kellermann 26e0e1d25a time/ISO8601: allow omitting the "Z" suffix
And allow "Z" suffix after date.
2019-08-19 22:42:39 +02:00
Max Kellermann 6412efb6e4 time/ISO8601: allow omitting the time of day 2019-08-19 22:42:06 +02:00
Max Kellermann 995783bb2f test/TestISO8601: unit test for time/ISO8601 2019-08-19 22:41:54 +02:00
Max Kellermann f909615b14 include cleanups (powered by iwyu) 2019-08-15 17:57:20 +02:00
Max Kellermann 96a1c69c29 tag/Handler: add virtual method OnPicture()
Preparing for https://github.com/MusicPlayerDaemon/MPD/issues/42
2019-08-12 20:31:43 +02:00
Max Kellermann 4a47bbd816 IcyMetadataParser: implement charset conversion 2019-08-10 10:07:13 +02:00
Max Kellermann 7654038d65 util/UriQueryParser: new library 2019-08-09 20:39:34 +02:00
Max Kellermann 40a2880857 util/UriUtil: split 2019-08-09 20:21:12 +02:00
Max Kellermann cde6c46d2f util/Macros: replace with std::size() (C++17) 2019-08-03 13:10:49 +02:00
Max Kellermann 8f981845dc switch to C++17
Time to move on, two years after 2017.
2019-08-03 12:57:56 +02:00
Max Kellermann af99f9fc90 pcm/Volume: convert S16 to S24 to preserve quality and reduce noise
Applying software volume to S16 samples means several bits of
precision are lost; at 25% volume, two bits are lost.  Additionally,
dithering adds some noise.

The problem gets worse when you apply the software volume code twice:
for the software mixer volume, and again for the replay gain.  This
loses some more precision and adds even more dithering noise, which
can become audible (see
https://github.com/MusicPlayerDaemon/MPD/issues/542).

By converting everything to 24 bit, we need to shift only two bits to
the right instead of ten, losing nearly no precision, and dithering is
not needed.  Even if the output device is unable to play S24 directly,
we can convert back to S16 with only one stage of dithering.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/542
2019-07-30 20:03:37 +02:00
Max Kellermann 991bbea875 Merge branch 'v0.21.x' 2019-07-29 11:32:00 +02:00
Max Kellermann 90ea3bf985 playlist/Song: support backslash in relative URIs
Closes https://github.com/MusicPlayerDaemon/MPD/issues/607
2019-07-29 09:58:53 +02:00
Max Kellermann 83b0871248 test/test_translate_song: remove unused variable "s1" 2019-07-29 09:52:57 +02:00
Max Kellermann d8aec4b2dc test/run_decoder: catch StopDecoder
This exception is usually thrown by class DecoderBridge, but the Opus
plugin (ab)uses it as well, so we need to catch it.
2019-07-12 17:49:12 +02:00
Max Kellermann 5fa7610264 pcm/Volume: Open() returns output sample format
Prepare for a new mode which may convert to a different sample format
when applying volume, to reduce dithering.
2019-07-05 19:03:00 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann 4650a903b4 decoder/Bridge: add `noexcept` 2019-07-05 08:57:51 +02:00
Max Kellermann beed004b10 pcm/Export: add GetSilence() 2019-06-26 16:04:46 +02:00
Max Kellermann 730e67d766 test/test_pcm_export: add tests for Get{In,Out}put{Frame,Block}Size() 2019-06-26 16:01:19 +02:00
Max Kellermann bf26adf555 pcm/Dsd{16,32}: stash odd frames away for the next call
Similar to commit 32380d1db0, these are
the final parts for really fixing
https://github.com/MusicPlayerDaemon/MPD/issues/469
2019-06-18 11:19:27 +02:00
Max Kellermann 28e07e900f pcm/Export: convert the DSD bools to an enum
These options are exclusive.
2019-06-17 22:35:00 +02:00
Max Kellermann 32380d1db0 pcm/Dop: stash odd frames away for the next call
First part of the "real" fix for
https://github.com/MusicPlayerDaemon/MPD/issues/469
2019-06-17 22:18:44 +02:00
Max Kellermann e87f0ca771 pcm/Pcm*: drop more "Pcm" prefixes from source file names 2019-06-17 11:17:48 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann fd5e74dbd0 pcm/Pcm{Dop,Export}: drop "Pcm" prefix 2019-06-16 12:11:44 +02:00
Max Kellermann bd6b7aa88e archive/Lookup: move to fs/LookupFile.cxx
This can be used for other purposes as well.
2019-06-15 14:26:26 +02:00
Max Kellermann fcf6415963 archive/Lookup: pass class Path 2019-06-15 14:06:50 +02:00
Max Kellermann be79b44dc8 archive/Lookup: pass const pointer 2019-06-15 14:04:34 +02:00
Max Kellermann 17f207ffd1 archive/Lookup: return AllocatedPath 2019-06-15 13:57:28 +02:00
Max Kellermann 548aa00111 tag/Handler: pass StringView to OnTag() and OnPair()
Eliminates a number of allocations, because callers don't need to copy
the strings to a newly allocated buffer only to null-terminate them.
And most callers don't need to have a null-terminated string.
2019-06-06 13:00:53 +02:00
Max Kellermann 71f9332bd3 test/TestCircularBuffer: add `constexpr` to fix -Wvla 2019-06-06 12:40:32 +02:00
Max Kellermann e1ac377812 archive/ArchiveLookup: replace output parameters with a struct 2019-05-31 19:56:25 +02:00
Max Kellermann 12e75a523a archive/ArchiveLookup: remove "suffix" output parameter
Let the caller do this.  Our GetSuffix() function was broken anyway.
2019-05-31 19:01:22 +02:00
Max Kellermann fa13648f2c archive/ArchiveLookup: throw on error 2019-05-31 18:52:11 +02:00
Max Kellermann 7739b3960c mixer/Listener: add `noexcept` 2019-05-31 14:09:47 +02:00
Max Kellermann 971450f0d4 input/InputStream: make IsEOF() and IsAvailable() const 2019-05-29 13:31:54 +02:00
Max Kellermann e0d5d88104 Log: make LogLevel the first parameter
Prepare for templated functions.
2019-05-23 12:17:59 +02:00
Max Kellermann 9a78371b5c DetachedSong: allow LoadFile(), Update() to throw 2019-05-22 10:19:25 +02:00
Max Kellermann 214ddee2f5 util/Time*: move to time/ 2019-05-08 15:47:58 +02:00
Max Kellermann 973c87b351 event/Call, ...: use wait() with predicate 2019-05-07 20:01:45 +02:00
Max Kellermann 1b5c1f75a4 input/InputStreams: pass std::unique_lock<> to various methods 2019-05-07 19:09:39 +02:00
Max Kellermann 92022658f9 thread/Cond: add wait() overload which takes a unique_lock<>
Just like std::condition_variable, which however has no way to specify
the std::mutex directly.
2019-04-26 11:51:45 +02:00
Max Kellermann b51bae5500 thread/*Cond: rename methods to match std::condition_variable 2019-04-25 19:46:43 +02:00
Max Kellermann c7c303eec3 db/DatabaseListener: add `noexcept` 2019-04-24 14:57:30 +02:00
Max Kellermann a30af2ba42 lib/chromaprint/DecoderClient: replace method PrintResult() 2019-04-05 13:40:05 +02:00
Max Kellermann 8006911a1f decoder/Client: add `noexcept` 2019-04-05 09:03:42 +02:00
Max Kellermann e78d825059 pcm/PcmConvert: eliminate Open() and Close()
Let the constructor and destructor do this.  This means that all users
have to be converted to allocate PcmConvert dynamically.
2019-04-04 21:01:08 +02:00
Max Kellermann 8a07724b23 test/RunChromaprint: move class ChromaprintDecoderClient to lib/chromaprint/ 2019-04-04 20:29:27 +02:00
Max Kellermann 5256929b17 tag/Chromaprint: move to lib/chromaprint/Context.hxx 2019-04-04 20:21:10 +02:00
Max Kellermann 93d91936b5 test/run_filter: check for partial writes 2019-03-25 08:59:34 +01:00
Max Kellermann 2220383d83 test/run_filter: move code to WriteOrThrow() 2019-03-25 08:59:25 +01:00
Max Kellermann 3231706628 test/run_filter: use class FileDescriptor 2019-03-25 08:53:58 +01:00
Max Kellermann 977a4570d9 Merge branch 'v0.21.x' 2019-03-21 11:49:41 +01:00
Max Kellermann 6bab3bcfea test/RunChromaprint: add missing `override` 2019-03-20 13:30:13 +01:00
Max Kellermann a66097129d Merge branch 'v0.21.x' 2019-03-16 14:08:22 +01:00
Max Kellermann 52ce39dc3e test/TestSongFilter: unit test for song filters
A few of those tests fail due to bugs.
2019-03-16 13:23:02 +01:00
Max Kellermann 7a3e15d8e5 test/meson.build: add section for filter tests 2019-03-16 13:23:02 +01:00
Max Kellermann cf66a60c60 test/MakeTag: add `noexcept` 2019-03-16 13:23:02 +01:00
Max Kellermann 9b26d451e4 test/MakeTag: remove `static` 2019-03-16 13:23:02 +01:00
Max Kellermann 137ffba1b4 test/test_translate_song: move MakeTag() to header 2019-03-16 13:23:02 +01:00
Max Kellermann 1a0865da7a test/run_filter: ensure that partial frames will not get passed to the filter 2019-03-14 14:26:53 +01:00
Max Kellermann a6ecf6c992 test/run_filter: move the buffer into the loop 2019-03-14 13:57:37 +01:00
Max Kellermann c176d94598 system/ByteOrder: move to util/ 2019-03-08 10:21:10 +01:00
Max Kellermann 6c28adbcd2 db/Plugin: use std::unique_ptr<> to manage Database pointers 2019-02-20 20:43:31 +01:00
Max Kellermann e9c45a9140 playlist/Registry: add RAII class 2019-02-05 23:03:29 +01:00
Max Kellermann 7a23c123c8 decoder/List: add RAII class 2019-02-05 22:12:22 +01:00
Max Kellermann 9e73ea77b4 input/Init: add RAII class 2019-02-05 22:07:49 +01:00
Max Kellermann b0739eca87 test/ConfigGlue: merge duplicate code from various debug programs 2019-02-05 21:56:20 +01:00
Max Kellermann c9ba4f3f9c archive/List: add RAII class 2019-02-05 21:40:07 +01:00
Max Kellermann 48ec09ab1e test/net/TestIPv4Address: make literal unsigned to work around -Wsign-compare 2019-01-21 14:39:24 +01:00
Max Kellermann 6a68e1c3f3 test/net/TestIPv6Address: work around failure on macOS 2019-01-21 12:13:52 +01:00
Max Kellermann 85f77ec81d test/net/TestLocalSocketAddress: can't use strcmp() if the string isn't null-terminated. 2019-01-21 12:12:36 +01:00
Max Kellermann 2cc2bab309 test/net: new unit tests 2019-01-20 21:05:21 +01:00
Max Kellermann ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Volodymyr Medvid 04f632296f
test/meson.build: run_storage depends on event lib
test/run_storage.cxx depends on EventThread/EventLoop from libevent.a.
Depend on it explicitly. This addresses build failure with
-Dtest=true -Dcurl=disabled -Ddbus=disabled
2018-11-15 19:01:43 +02:00
Max Kellermann 96ae0ec93a remove some autotools remains
Closes #396
2018-11-02 18:55:49 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann bb5918932b pcm/PcmUtils: rename to Clamp.hxx 2018-10-30 00:05:58 +01:00
Max Kellermann c92f0a1336 test/PcmFormat: add Float/32 bit test 2018-10-29 23:06:40 +01:00
Max Kellermann 8463441afe test/PcmFormat: rename FormatFloat to FormatFloat16 2018-10-29 23:06:37 +01:00
Max Kellermann 30e22b753b tag/Chromaprint: OO wrapper for a ChromaprintContext 2018-10-24 10:52:45 +02:00
Max Kellermann 01b6e1cbf2 test: use GTest instead of cppunit 2018-10-16 21:26:04 +02:00
Max Kellermann 94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann 224400074c player/CrossFade: use std::chrono::duration 2018-09-22 19:37:02 +02:00
Max Kellermann 90f4e97751 decoder/Client: use std::chrono::duration<double> instead of raw `double` 2018-09-21 20:42:34 +02:00
Max Kellermann 68f824a186 protocol/ArgParser: move struct RangeArg to separate header 2018-09-02 08:17:22 +02:00
Max Kellermann 4a1e885c0a net/Resolver: replace with more advanced implementation
The new implementation is copied from another project and is
BSD-licensed.  It is exception-safe and can parse IPv6 scope ids with
interface names.
2018-08-21 08:26:12 +02:00
Max Kellermann ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann 4accc1f159 test/run_neighbor_explorer: allocate ConfigData on the stack 2018-08-19 22:41:58 +02:00
Max Kellermann 80839b5372 test/run_input: allocate ConfigData in class GlobalInit 2018-08-19 22:41:08 +02:00
Max Kellermann dafa3f985a test/run_decoder: allocate ConfigData in class GlobalInit 2018-08-19 22:40:36 +02:00
Max Kellermann f865e1393c test/dump_rva2: remove obsolete fake function config_get_string() 2018-08-19 22:39:22 +02:00