Commit Graph

11430 Commits

Author SHA1 Message Date
Max Kellermann
2d3c23876c output/Timer: use C++11 initializers 2016-12-28 10:16:41 +01:00
Max Kellermann
bd8d8eef3e output/Timer: no "time" initialization if !started 2016-12-28 10:16:11 +01:00
Max Kellermann
e786207cc2 system/PeriodClock: indent with tabs 2016-12-28 01:18:42 +01:00
Max Kellermann
b042095ac2 event/Loop: use std::chrono 2016-12-28 01:15:08 +01:00
Max Kellermann
3413d1bf23 config/Global: add std::chrono::steady_clock::duration overload 2016-12-28 01:12:38 +01:00
Max Kellermann
018c5ef731 event/Loop: use C++11 initializers 2016-12-27 23:13:26 +01:00
Max Kellermann
fdb136f1fa StateFile: use C++11 initializers 2016-12-27 23:13:26 +01:00
Max Kellermann
9e33074735 output/Thread: move software_mixer_set_filter() call to Open()
.. and remove the obsolete method OpenFilter().
2016-12-27 14:44:39 +01:00
Max Kellermann
d6d465cdf4 output/Thread: fix assertion failure in CLOSE handler
Convert assertion to runtime check; this assertion could fail when the
output was closed due to an error before CLOSE arrived.
2016-12-27 07:57:22 +01:00
Max Kellermann
e76573cc1a output/Thread: use "true" instead of "1" 2016-12-27 07:53:02 +01:00
Max Kellermann
3fa6dc71e2 output/Source: add assertion 2016-12-26 20:10:00 +01:00
Max Kellermann
6fec269844 output/SharedPipeConsumer: add thread-safety documentation 2016-12-26 20:09:10 +01:00
Max Kellermann
b6004b6837 output/Source: release the mutex while the filter runs
The filter can take some time to finish, even more so on a weak
machine with a saturated CPU.  By not holding the mutex during that
time, we can reduce PlayerThread latency a lot, because that thread
needs to synchronize a lot with all outputs.
2016-12-26 20:02:15 +01:00
Max Kellermann
86d3b25aec output/Source: add Fill(), ReadTag(), PeekData(), ConsumeData()
Don't expose MusicChunk instances, provide higher-level access to
chunk contents.
2016-12-26 13:53:22 +01:00
Max Kellermann
8a407bfbb0 output/Thread: move code to new class AudioOutputSource 2016-12-26 13:35:19 +01:00
Max Kellermann
d30a590d9e configure.ac: use MPD_AUTO for libsndio and Haiku 2016-12-26 13:35:19 +01:00
Max Kellermann
f95e404be1 outputThread: optimize Command::OPEN
Try harder to skip steps (reopen filter, reopen output) if the
AudioOutput is already open.
2016-12-24 14:05:11 +01:00
Max Kellermann
ffb8b4fc68 output/Internal: add method ClearTailChunk() 2016-12-22 14:46:59 +01:00
Max Kellermann
f86d6b0162 output/Control: move pipe initialization to the OutputThread
Un-protect the SharedPipeConsumer instance, and make it available in
the OutputThread only.  This gives more well-defined mutex protection.
2016-12-22 14:04:38 +01:00
Max Kellermann
71c72ed072 output/Control: use Command::OPEN to unpause, remove special case 2016-12-22 14:04:38 +01:00
Max Kellermann
a8d343e07b output/Thread: update in_audio_format before ReopenFilter() 2016-12-22 14:04:34 +01:00
Max Kellermann
d020172181 output/Thread: keep the device open if the audio format hasn't changed
Add another condition to Reopen() which allows keeping it open.
2016-12-21 17:45:01 +01:00
Max Kellermann
e5c9f6c1fe output/Internal: add attribute request.audio_format
Make in_audio_format accessible only from within the OutputThread, and
add a new one for inter-thread communication.
2016-12-21 17:00:29 +01:00
Max Kellermann
176dc11748 output/Thread: ao_filter_chunk() throws exception on error
Move the error logging to AudioOutput::PlayChunk().
2016-12-20 17:40:11 +01:00
Max Kellermann
c2abd02b9b output/Thread: use ConstBuffer::skip_front() 2016-12-20 17:38:08 +01:00
Max Kellermann
12ecfdd423 output/Thread: convert pointer to reference 2016-12-20 17:35:38 +01:00
Max Kellermann
67cfbfc2f3 output/SharedPipeConsumer: update API documentation 2016-12-20 16:35:14 +01:00
Max Kellermann
fc83d38e67 input/curl: wrap CURLM* in new class CurlMulti 2016-12-19 16:41:12 +01:00
Max Kellermann
7063c423eb input/curl: rename class CurlMulti to CurlGlobal 2016-12-19 16:37:01 +01:00
Max Kellermann
36b93993cf input/curl: wrap CURL* in new class CurlEasy 2016-12-19 14:42:04 +01:00
Max Kellermann
ceffc5aa72 input/curl: remove duplicate InitEasy() call 2016-12-19 14:38:50 +01:00
Max Kellermann
ccb45b6f6e output/Client: new interface to replace direct access to class PlayerControl 2016-12-14 20:29:15 +01:00
Max Kellermann
d2e47e014a player/Thread: reduce unlock/lock overhead in PlayerCommand::PAUSE handler 2016-12-14 20:24:52 +01:00
Max Kellermann
a5b8d7917f player/Thread: mutex must be locked inside OpenOutput() 2016-12-14 20:23:23 +01:00
Max Kellermann
d0e735ee4b player/Thread: mutex must be locked inside CheckDecoderStartup() 2016-12-14 20:13:18 +01:00
Max Kellermann
ece5971027 output/Multiple: move Wait() to struct PlayerControl
Eliminate a dependency from MultipleOutputs on PlayerControl.
2016-12-14 19:37:01 +01:00
Max Kellermann
7c6b0d5c31 player/Thread: use class ScopeLock 2016-12-14 13:10:48 +01:00
Max Kellermann
03151310cf player/Control: add method LockApplyBorderPause() 2016-12-14 13:09:48 +01:00
Max Kellermann
baa2bc0c38 player/Control: add method LockSetOutputError() 2016-12-14 13:01:17 +01:00
Max Kellermann
7e1b53480e output/MultipleOutputs: parallelize EnableDisable() 2016-12-14 08:41:42 +01:00
Max Kellermann
6425b4f9f5 output/MultipleOutputs: parallelize AudioOutput destruction
Reduce latency by stopping all AudioOutputs asynchronously.
2016-12-14 08:35:07 +01:00
Max Kellermann
fb907f5f76 output/Thread: KILL implicitly closes and disables the AudioOutput
Reduce shutdown latency by two commands per output.
2016-12-14 08:29:09 +01:00
Max Kellermann
b107a1583f output/MultipleOutputs: move code to AudioOutput::EnableDisableWait() 2016-12-14 08:00:43 +01:00
Max Kellermann
ced3f320eb output/MultipleOutputs: reduce lock/unlock calls in EnableDisable()
Use ScopeLock to manage the lock; don't unlock after obtaining the
"really_enabled" flag; keep the same lock during EnableWait() /
DisableWait().
2016-12-14 07:54:05 +01:00
Max Kellermann
a9d7293818 output/Thread: wake up the player thread periodically while playing
Without this, the pipe would run empty very often, which may result in
an xrun if the roundtrip to the PlayerThread and back takes too long.
By waking up the PlayerThread before the pipe runs empty, we make MPD
much more latency tolerant, which is a major optimization.
2016-12-13 22:39:49 +01:00
Max Kellermann
add42e9edf NEWS: add "player" section 2016-12-13 22:39:49 +01:00
Max Kellermann
265ad4b96a output/Thread: eliminate redundant nullptr check 2016-12-13 22:20:41 +01:00
Max Kellermann
92eeb4969f output/Thread: don't wake up the player after receiving command in Play()
If we have a pending command, then the player thread is already awake.
Even if not, we'll wake it up as soon as we have finished the command.
2016-12-13 22:17:06 +01:00
Max Kellermann
6fcddaf8fa output/Thread: use AtScopeExit() to revert the in_playback_loop flag 2016-12-13 22:15:52 +01:00
Max Kellermann
41fd583fbc output/Thread: eliminate one ScopeLock 2016-12-13 21:57:03 +01:00