summaryrefslogtreecommitdiff
path: root/src/filter
AgeCommit message (Collapse)Author
2021-01-16clang-tidy: mark a bunch of variables constexprRosen Penev
Found with cppcoreguidelines-interfaces-global-init Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-01-01copyright year 2021Max Kellermann
2020-11-16filter/ffmpeg: detect the output sample formatMax Kellermann
Some FFmpeg filters change the sample format, and since MPD assumes this never happens, this results in loud noise instead of music. This commit finally implements the TODO comment by sending one frame of silence to the filter and checking the output frame's format. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1009
2020-11-04filter/LoadChain: use the AutoConvertFilterMax Kellermann
This adds support for input samples other than 16 bit to the FFmpeg filter plugin.
2020-11-04filter/AutoConvert: move the Filter class to TwoFilters.cxxMax Kellermann
2020-11-04filter/AutoConvert: eliminate AutoConvertFilter if possibleMax Kellermann
If no conversion is necessary, return the child Filter as-is. This allows removing all nullptr checks from AutoConvertFilter.
2020-11-04filter/ffmpeg: interleave the output AVFrameMax Kellermann
If the FFmpeg filter outputs planar data, interleave it, just like the FFmpeg decoder plugin does.
2020-11-04filter/convert: convert_filter_new() returns std::unique_ptrMax Kellermann
2020-11-04filter/chain: pass std::string_view to filter_chain_append()Max Kellermann
2020-11-04filter/LoadChain: use IterableSplitString()Max Kellermann
2020-11-04filter/chain: copy the child nameMax Kellermann
filter_chain_parse() passes a temporary string pointer which results in a use-after-free in the PreparedChainFilter::Child::Open() error message.
2020-11-04filter/chain: remove unused field ChainFilter::Child::nameMax Kellermann
2020-03-16remove gcc_unusedRosen Penev
[[maybe_unused]] (introduced in C++17) is standard C++. https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused says that this is equivalent to the GNU unused attribute. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12replace stdint.h with cstdintRosen Penev
The former is deprecated by C++14. The standard says they are the same: The header defines all types and macros the same as the C standard library header<stdint.h>. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12replace assert.h with cassertRosen Penev
The former was deprecated with C++14. According to the C++11 and C++17 standards, both files are identical. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12[clang-tidy] use nodiscardRosen Penev
Introduced in C++17. It replaces gcc's warn_unused_result. Found with modernize-use-nodiscard. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01*: add `explicit`Max Kellermann
2020-02-01*: use `auto`Max Kellermann
2020-01-31[clang-tidy] use override instead of virtualRosen Penev
Found with modernize-use-override Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-01-18AudioFormat: move to pcm/Max Kellermann
2020-01-18copyright year 2020Max Kellermann
2019-12-09filter/plugins: add missing meson dependencyJacob Vosmaer
2019-08-26filter/Observer: add `noexcept`Max Kellermann
2019-08-26filter/Filter: document that Flush() can throwMax Kellermann
2019-08-26filter/Filter: allow throwing any exceptionMax Kellermann
2019-08-26filter/Registry: rename the source fileMax Kellermann
2019-07-30pcm/Volume: convert S16 to S24 to preserve quality and reduce noiseMax Kellermann
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-05pcm/Volume: Open() returns output sample formatMax Kellermann
Prepare for a new mode which may convert to a different sample format when applying volume, to reduce dithering.
2019-07-05include cleanups (powered by iwyu)Max Kellermann
2019-06-17pcm/Pcm*: drop more "Pcm" prefixes from source file namesMax Kellermann
2019-06-17Copyright year 2019Max Kellermann
2019-04-04pcm/PcmConvert: eliminate Open() and Close()Max Kellermann
Let the constructor and destructor do this. This means that all users have to be converted to allocate PcmConvert dynamically.
2019-04-04filter/Convert: make in_audio_format `const`Max Kellermann
2019-03-25Merge branch 'v0.21.x'Max Kellermann
2019-03-24filter/AutoConvert: implement Flush()Max Kellermann
2019-03-24filter/Filter: fix typo in API docMax Kellermann
2019-03-24filter/ffmpeg: use only one AVFrameMax Kellermann
The two were never used at the same time, and merging them saves one allocation.
2019-03-24filter/ffmpeg: use av_buffersrc_add_frame() instead of ↵Max Kellermann
av_buffersrc_write_frame() This transfers ownership of the buffer instead of adding another reference.
2019-03-24filter/ffmpeg: call av_frame_unref() before av_buffersink_get_frame()Max Kellermann
Fix another memory leak. Closes https://github.com/MusicPlayerDaemon/MPD/issues/514
2019-03-24filter/ffmpeg: remove unnecessary av_frame_make_writable() callMax Kellermann
A newly allocated buffer doesn't need this call; it only adds overhead for copying the data.
2019-03-24filter/ffmpeg: call av_frame_unref() before av_frame_get_buffer()Max Kellermann
av_frame_get_buffer() leaks memory if buffers were already allocated. Fixes one of the memory leaks of https://github.com/MusicPlayerDaemon/MPD/issues/514
2019-03-18filter/ffmpeg: new filter pluginMax Kellermann
2019-03-18filter/hdcd: include cleanupMax Kellermann
2019-03-18filter/hdcd: move generic code to class FfmpegFilterMax Kellermann
2019-03-18filter/hdcd: fix typoMax Kellermann
2019-03-18filter/hdcd: new filter plugin based on FFmpeg's "af_hdcd"Max Kellermann
2019-03-18filter/plugins/null: move code to src/filter/NullFilter.hxxMax Kellermann
2019-03-12filter/registry: move `extern` lines to plugin headersMax Kellermann
2019-03-12filter/normalize: clean up forward declarationsMax Kellermann
2018-11-19check.h: remove obsolete headerMax Kellermann
Since we switched from autotools to Meson in commit 94592c14062d5afc9482d11baa401648082022c0, 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.