Commit Graph

1851 Commits

Author SHA1 Message Date
Max Kellermann 8322ae5a4c output/Control: use class ScopeUnlock() 2018-01-04 08:41:19 +01:00
Max Kellermann 98a7c62d7a player/Thread: don't send silence if decoder is slow
The output plugin shall decide whether to insert silence or do nothing
at all.  The ALSA output plugin has already implemented this.
Inserting silence is not necessary or helpful for some plugins, and
may even hurt them (e.g. "recorder").
2018-01-03 17:36:41 +01:00
Max Kellermann 1954e94de2 Merge branch 'work_tag' of git://github.com/loujine/MPD
Closes #181
2018-01-03 11:47:02 +01:00
Max Kellermann 6d0d8cf9cf filter/Filter: add virtual method Flush()
This will be used by filters which have internal buffers which need to
be flushed at the end, e.g. the "soxr" resampler.
2018-01-02 23:15:51 +01:00
Max Kellermann 5ede02aed8 filter/FilterConfig: rename to LoadChain.cxx 2018-01-02 23:09:36 +01:00
Max Kellermann b0199245d5 output/Thread: move code to method InternalDrain() 2018-01-02 18:03:48 +01:00
Max Kellermann b93e3b2cf6 output/Thread: move code to method InternalCloseError() 2018-01-02 18:02:14 +01:00
Max Kellermann ae7fcf4c6b output/Thread: move common code to method Failure() 2018-01-02 18:00:20 +01:00
Max Kellermann 1607754771 output/Thread: update "last_error" after filter/play errors 2018-01-02 17:59:37 +01:00
Max Kellermann 028f659c40 output/Thread: move error handling code into the catch block 2018-01-02 17:48:14 +01:00
Max Kellermann 8dfdacf128 output/Thread: AudioOutput::Play() must not return zero 2018-01-02 17:47:46 +01:00
Max Kellermann f4a56f839f output/haiku: remove size==0 check from Play()
By API contract, this parameter must not be zero.
2018-01-02 17:45:14 +01:00
Max Kellermann 67a8eedca0 output/ao: round write_size down to a multiple of the frame size 2018-01-02 17:33:33 +01:00
Max Kellermann be65c7d5d0 config/Block: add method GetPositiveValue()
Adds missing checks to several plugins.
2018-01-02 17:24:34 +01:00
Max Kellermann 46406d6cca output/ao: use class SafeSingleton for libao initialization 2018-01-02 12:13:51 +01:00
Max Kellermann d2358b42b6 output/Source: drop the "_instance" suffix from variable names 2018-01-02 09:59:22 +01:00
Max Kellermann 551ac56a33 Filter/Internal: split header 2018-01-01 18:48:34 +01:00
loujine 42959982a9 Add basic support for MUSICBRAINZ_WORKID tag 2017-12-30 19:05:21 +00:00
Max Kellermann c40354bbcb player/Outputs: abstract interface wrapping class MultipleOutputs 2017-12-29 16:39:05 +01:00
Max Kellermann c04aafb4e3 output/Multiple: add "noexcept" 2017-12-29 16:29:49 +01:00
Max Kellermann edef62df86 filter/Internal: return std::unique_ptr<Filter> 2017-12-27 11:56:05 +01:00
Max Kellermann e2621d5e44 filter/Plugin: return std::unique_ptr<PreparedFilter> 2017-12-27 11:39:01 +01:00
Max Kellermann 03cf6591c0 output/Source: convert prepared_filter to reference 2017-12-27 11:21:43 +01:00
Max Kellermann 25fa3ccade MusicChunk, player/Thread: use std::unique_ptr<Tag> 2017-12-20 15:02:14 +01:00
Max Kellermann a17a481e30 event/BufferedSocket: add "noexcept" 2017-12-20 10:42:17 +01:00
Max Kellermann 8ac73a9eba output/alsa: add attributes "dop" and "allowed_formats" 2017-12-19 11:57:52 +01:00
Max Kellermann 86a06a7acc output/Interface: add "attributes" map
These attributes are printed in the "outputs" response, and the new
command "outputset" allows setting new values.

No attributes are currently implemented.
2017-12-19 11:57:52 +01:00
Max Kellermann 39dc83bd82 output/Print: print the plugin name 2017-12-19 11:52:10 +01:00
Max Kellermann 503063cddc output/Print: use %u for the index 2017-12-19 11:52:09 +01:00
Max Kellermann 914df18bf9 Main, ...: catch any exception, not just std::runtime_error 2017-12-19 10:56:23 +01:00
Max Kellermann 37c27fa606 output/Interface: convert need_fully_defined_audio_format to flag 2017-12-19 08:41:34 +01:00
Max Kellermann edee8a3446 Compiler.h: add gcc_returns_nonnull, gcc_returns_twice 2017-12-18 23:00:13 +01:00
Max Kellermann 6246d36fe6 Merge branch 'v0.20.x' 2017-12-16 20:56:06 +01:00
Yue Wang f1ef9f9d31 OSXOutputPlugin: set the buffer time to be 100ms
[mk: the following text was copied from
https://github.com/MusicPlayerDaemon/MPD/pull/167]

For certain format (hi-res files) and normal buffer size hardware, The
hardware may at once consume most of the buffers. However, in Delay()
function, MPD is supposed to wait for 25 ms after the next try. it
will create a hiccup. The negative impact is much major than
increasing the latency.

I understand larger buffers come at a price. That's why in my earlier
commit last year I significantly reduced it. However, the buffer size
in CoreAudio is set according to the hardware, which is super small
latency. For instance, the system audio of 2015 generation of macbook
pro has maximum buffer size of 4096 samples, which is just 0.09s for
44.1k framerate, or 0.04s for 96k frames --- . compare to the 0.5 sec
latency alsa plugin has, even if we quadruple it, it's still super
tiny.
2017-12-12 10:56:42 +01:00
Max Kellermann fbc4bb29dc Merge branch 'v0.20.x' 2017-12-03 16:22:08 +01:00
Max Kellermann de90d401d2 MusicChunk: add magic value IGNORE_REPLAY_GAIN
This fixes spurious replay gain logs when the player inserts silence
chunks, because those silence chunks had no replay gain attached,
resetting the ReplayGainFilter state, flipping it forth and back.
2017-12-03 11:39:12 +01:00
Yue Wang 7ba7ce3af7 Correctly set the mixer plugin for osx output 2017-12-02 23:29:23 -08:00
Max Kellermann 7d579e7400 lib/alsa/NonBlock: throw exception on error
Avoid another potential deadlock: if no file descriptors are
registered, our non-blocking ALSA code cannot ever work.
2017-11-14 21:08:07 +01:00
Max Kellermann e0f777d4eb output/alsa: move code to LockCaughtError() 2017-11-14 21:07:59 +01:00
Max Kellermann febd1ad09c output/alsa: fix deadlock bug
After UnlockActivate() returns, we not only need to check for errors,
but also for more room in the ring buffer.  If we don't check the ring
buffer, it may be drained already, and the cond.wait() call will never
finish.

Closes #151
2017-11-14 21:02:53 +01:00
Max Kellermann e2c81aa9ea Merge branch 'v0.20.x' 2017-11-14 12:31:13 +01:00
Max Kellermann 014f8cd693 output/httpd: flush encoder after tag
Without the flush, ReadPage() may not return any data, or not all
data.  This may result in incomplete ddata the new "header" page,
corrupting streams with some encoders such as Vorbis.

Fixes #145
2017-11-14 12:00:14 +01:00
Max Kellermann c582a9faae event/MultiSocketMonitor: add "noexcept" 2017-11-12 17:42:50 +01:00
Max Kellermann 390e830994 {mixer,output}/alsa: migrate from DeferredMonitor to DeferEvent 2017-11-12 17:27:58 +01:00
Max Kellermann 44c60567dd output/alsa: add "allowed_formats" setting
Allows defining a list of supported audio formats, and allows
switching on and off DoP with certain formats.

This is a first rough draft.  The setting syntax and its semantics may
still be redesigned.
2017-11-10 23:05:50 +01:00
Max Kellermann 20199e770c output/shout: use the shout_metadata_t only once
There is no documentation on whether calling shout_metadata_add()
multiple times on one instance is allowed.  To be sure, let's allocate
the object on demand each time in SendTag().
2017-11-10 22:30:53 +01:00
Max Kellermann 4c824e5309 output/shout: simplify shout_tag_to_metadata() 2017-11-10 22:26:25 +01:00
Max Kellermann 981bc85879 output/shout: relax quality and bitrate checks, forward as-is 2017-11-10 22:19:00 +01:00
Max Kellermann 015527d870 output/shout: make "quality" and "bitrate" local variables 2017-11-10 22:17:51 +01:00
Max Kellermann 6464b4b372 encoder/Configured: glue code to initialize PreparedEncoder 2017-11-10 21:54:57 +01:00