Commit Graph

13663 Commits

Author SHA1 Message Date
Max Kellermann
8c638c50a3 player/Thread: remove obsolete buffered_before_play attribute 2018-09-23 16:50:04 +02:00
Max Kellermann
5b2374b949 player/Thread: calculate buffered_before_play based on a fixed duration
Previously, there was the setting `buffered_before_play` which
specified a percentage of the audio buffer, defaulting to `10%`.  That
was working well enough for quite some time, until high-quality audio
formats became common.

At 44.1 kHz, 16 bit stereo, MPD collected 2.3 seconds worth of data in
the buffer before starting playback.  With the same default settings
and 192 kHz, 24 bit stereo, that was only 0.27 seconds.

Making this depend on the byte size only leads to high latency at low
quality, and too little data at high quality.  The natural choice
would be to use a duration instead of a byte size, which should give
the same good experience with all audio formats.

Since the `buffered_before_play` configuration setting was not
understood well by users and caused more harm than good, this commit
deprecates it.  It has now no effect.
2018-09-23 15:46:29 +02:00
Max Kellermann
c1600bcf3d player/Thread: copy buffered_before_play 2018-09-23 15:46:27 +02:00
Max Kellermann
a82d864c91 config/File: print warning about deprecated options 2018-09-23 15:43:38 +02:00
Max Kellermann
dcac32a6c4 AudioFormat: add implicit cast to duration::rep
Fixes integer truncation bugs (closes #359).
2018-09-23 15:15:53 +02:00
Max Kellermann
5286477f73 Chrono: remove unnecessary typedef rep
It is already inherited by the base class, and we don't need to import
it explicitly.
2018-09-23 15:15:18 +02:00
Max Kellermann
2f3845ef51 player/Thread: remove buffered_before_play from decoder_wakeup_threshold formula
Simplify the formula, and I guess this makes the formula more
reliable.  Imagine somebody configured `buffered_before_play` larger
than 25%; then the decoder would be woken up all the time.  This
doesn't seem logical.  On the other hand, it's easy to understand that
the decoder should be woken up below 75% buffer fill.
2018-09-23 15:00:47 +02:00
Max Kellermann
1191025bbf player/Thread: add attribute decoder_wakeup_threshold
Calculate the value only once.
2018-09-22 19:56:00 +02:00
Max Kellermann
bfd261929e AudioFormat: remove obsolete method GetTimeToSize() 2018-09-22 19:39:20 +02:00
Max Kellermann
84de88841b player/CrossFade: use AudioFormat::SizeToTime() instead of GetTimeToSize() 2018-09-22 19:37:45 +02:00
Max Kellermann
224400074c player/CrossFade: use std::chrono::duration 2018-09-22 19:37:02 +02:00
Max Kellermann
863722545f player/CrossFade, ...: use lround() 2018-09-22 19:08:03 +02:00
Max Kellermann
d3d1d37782 AudioFormat: add TimeToSize(), SizeToTime() 2018-09-21 20:51:08 +02:00
Max Kellermann
1a2012a97e player/Control: convert total_play_time to FloatDuration 2018-09-21 20:50:15 +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
d1bcd98f79 Chrono: add FloatDuration 2018-09-21 20:42:30 +02:00
Max Kellermann
39542de69d Chrono: add static method Cast() 2018-09-21 20:41:23 +02:00
Max Kellermann
1d00d55d53 player/Thread: stop buffering if buffer is full
Shouldn't ever happen, but who knows...
2018-09-21 19:05:25 +02:00
Max Kellermann
a190db0873 player/Thread: simplify loop condition 2018-09-21 18:58:38 +02:00
Max Kellermann
e3142312bb player/Control: convert to class 2018-09-21 18:12:28 +02:00
Max Kellermann
e5d1ac0bd0 player/Thread: move functions into PlayerControl 2018-09-21 18:09:14 +02:00
Max Kellermann
c0411fa412 decoder/Thread: add noexcept 2018-09-21 17:58:34 +02:00
Max Kellermann
781e690012 player/Thread: catch and log initialization errors 2018-09-21 17:35:32 +02:00
Max Kellermann
9a2d71341e player/Control: apply CamelCase to struct player_status 2018-09-21 17:22:35 +02:00
Max Kellermann
6db6d3c50c player/Thread: move StartPlayerThread() into PlayerControl 2018-09-21 17:14:19 +02:00
Max Kellermann
0e2c597884 MusicBuffer: remove noexcept from constructor
The `SliceBuffer` constructor can throw.
2018-09-21 17:11:52 +02:00
Max Kellermann
debdf9bb96 decoder/{Thread,Control,...}: rename source files, drop prefix 2018-09-21 17:01:24 +02:00
Max Kellermann
218d9383d7 decoder/Thread: move decoder_thread_start() into DecoderControl 2018-09-21 16:57:54 +02:00
Max Kellermann
af64bd5088 Thread/Thread: disallow copying 2018-09-21 16:55:09 +02:00
Max Kellermann
050f81c4fe Thread/Thread: document Start() exception 2018-09-21 16:53:52 +02:00
Rainer Hihn
6ebe772e2f Proposal for CMDSYN 2018-09-21 10:09:37 +02:00
Max Kellermann
c9ee6dd4ca doc/user.rst: document the sles output plugin 2018-09-11 20:44:54 +02:00
skidoo23
38b183fac2 user.rst: fixed typo state_file_interval 2018-09-11 16:35:57 +02:00
Max Kellermann
ab678787f4 java/Ref: API doc line breaks 2018-09-06 20:04:46 +02:00
Max Kellermann
23556585ca java/Ref: add LocalRef::GetEnv() 2018-09-06 20:04:40 +02:00
Max Kellermann
728e4e9a38 util/StringCompare: add StringEndsWithIgnoreCase(), StringStartsWithIgnoreCase() 2018-09-06 19:52:43 +02:00
Max Kellermann
2d6f9f9a9c Util/WStringAPI: non-Windows implementation of _wcs*cmp() 2018-09-06 19:49:45 +02:00
Max Kellermann
c2e2e5543e util/WStringAPI: add wcscoll() wrapper 2018-09-06 19:39:28 +02:00
Max Kellermann
349d8eb248 util/WStringCompare: add "noexcept" 2018-09-06 19:35:09 +02:00
Max Kellermann
94b96bde9b util/WStringCompare: wcpcpy() and wcsdup() are available on Android 2018-09-06 19:33:50 +02:00
Max Kellermann
45ffc864c5 util/StringCompare: add more function attributes 2018-09-06 19:23:13 +02:00
Max Kellermann
19d9ce260a fs/io/FileOutputStream: disallow copying 2018-09-03 14:36:01 +02:00
Max Kellermann
0701333ec1 db/proxy: forward filter as expression to server
This adds support for the full set of MPD 0.21 filter types.
2018-09-02 22:39:45 +02:00
Max Kellermann
a8e70f0901 db/proxy: forward sort and window to server 2018-09-02 17:51:30 +02:00
Max Kellermann
c7c32a3ce9 db/Print: move sort/window emulation code to class DatabaseVisitorHelper
That way, each plugin can decide to implement it better.
2018-09-02 17:37:02 +02:00
Max Kellermann
53170ca2f2 .travis.yml: install Boost 1.67 from a PPA
Apparently, Travis-CI will never upgrade its ancient Ubuntu Trusty,
so I have to get Boost from somewhere else.

Thanks to Martin Hierholzer for his PPA.
2018-09-02 17:28:01 +02:00
Max Kellermann
94694e0f33 db/simple: pass DatabaseSelection to WalkMount()
This passes the new `sort` and `window` attributes to the mounted
database.
2018-09-02 17:13:35 +02:00
Max Kellermann
a73176a1e9 db/Helpers: fix include guard 2018-09-02 12:32:33 +02:00
Max Kellermann
e6a974a93e db/Selection: add sort and window
Remove them as parameters from `db_selection_print()`.
2018-09-02 11:10:04 +02:00
Max Kellermann
9894967fcb db/Selection: move bool attribute to the end
May allow a better memory layout.
2018-09-02 11:10:04 +02:00