Max Kellermann
3854211694
input/Plugin: pass EventLoop& to init()
...
Eliminate dependency on io_thread_get().
2017-01-26 09:26:25 +01:00
Max Kellermann
58ac72f79d
input/nfs: use NfsFileReader::GetEventLoop()
2017-01-26 09:25:56 +01:00
Max Kellermann
6d5904801e
lib/nfs/FileReader: use nfs_get_event_loop()
...
Make sure we're using the same EventLoop as the NfsManager.
2017-01-26 09:23:49 +01:00
Max Kellermann
d4993c405e
lib/nfs/Glue: add EventLoop& accessor
2017-01-26 09:23:25 +01:00
Max Kellermann
7af8e3937f
lib/nfs/FileReader: use C++11 initializers
2017-01-26 09:21:57 +01:00
Max Kellermann
f8eeded528
input/async: pass EventLoop& to constructor
2017-01-25 23:18:33 +01:00
Max Kellermann
c3fa7e13cf
input/Plugin: include cleanup
2017-01-25 23:18:17 +01:00
Max Kellermann
5c18b0a94d
input/curl: use CurlGlobal::GetEventLoop()
2017-01-25 23:16:56 +01:00
Max Kellermann
ecbad638f1
input/async: add method GetEventLoop()
2017-01-25 23:15:52 +01:00
Max Kellermann
611ce6e756
lib/nfs/{FileReader,Glue}: pass EventLoop&
...
Eliminate dependency on io_thread_get().
2017-01-25 23:02:02 +01:00
Max Kellermann
4140e9b857
IOThread: make io_thread_run() static
2017-01-25 23:00:31 +01:00
Max Kellermann
8fd9d91974
output/Plugin: pass EventLoop& to init()
...
Eliminate dependency on io_thread_get().
2017-01-25 22:54:41 +01:00
Max Kellermann
d3f35dab1e
output/ao: convert to class, make attributes private
2017-01-25 10:46:09 +01:00
Max Kellermann
487e2618cd
output/ao: use AudioOutputWrapper
2017-01-25 10:45:20 +01:00
Max Kellermann
30d5186db4
output/ao: use const_cast instead of the union hack
2017-01-25 10:44:19 +01:00
Max Kellermann
cbe59714d4
output/solaris: convert to class, make attributes private
2017-01-25 10:33:38 +01:00
Max Kellermann
704a28ca17
output/solaris: use AudioOutputWrapper
2017-01-25 10:29:42 +01:00
Max Kellermann
8d70d10aba
output/httpd: use AudioOutputWrapper
2017-01-25 10:05:08 +01:00
Max Kellermann
ddd8b16f2b
output/roar: use AudioOutputWrapper::Init()
2017-01-25 10:05:08 +01:00
Max Kellermann
b79ce77ec5
output/Wrapper: add missing include
2017-01-25 10:05:08 +01:00
Max Kellermann
fead4bbfd9
output/Plugin: convert pointers to references
2017-01-25 09:48:59 +01:00
Max Kellermann
68bb738af2
input/alsa: use snd_pcm_?w_params_alloca()
2017-01-25 08:47:20 +01:00
Max Kellermann
6b968beede
output/alsa: convert to class, make attributes private
2017-01-24 23:08:16 +01:00
Max Kellermann
f68dd1bffb
output/alsa: make AlsaSetup() an AlsaOutput method
2017-01-24 23:06:33 +01:00
Max Kellermann
f92b71ca99
output/alsa: move code from AlsaSetup() to AlsaSetupSw()
2017-01-24 23:05:29 +01:00
Max Kellermann
2b79fe2d6a
output/alsa: move code from AlsaSetup() to AlsaSetupHw()
2017-01-24 22:48:48 +01:00
Max Kellermann
44dd9af276
lib/upnp/Util: pass single delimiter character to stringToTokens()
2017-01-23 19:34:55 +01:00
Max Kellermann
d3013d4f8c
lib/upnp/Util: remove parameter "skipinit", always true
2017-01-23 19:28:07 +01:00
Max Kellermann
678524ad21
lib/upnp/WorkQueue: fix race condition
...
With "ok==false", newly created threads may quit instantly.
2017-01-23 19:25:30 +01:00
Max Kellermann
32a64481f2
lib/upnp: fix bad std::chrono cast
...
libupnp provides seconds, not whatever time unit is used by
std::chrono::steady_clock.
2017-01-23 19:16:14 +01:00
Max Kellermann
1776015c6c
db/simple: drop redundant "virtual"
2017-01-23 18:57:23 +01:00
Max Kellermann
f1c71a26e3
db/proxy: drop redundant "virtual"
2017-01-23 18:56:45 +01:00
Max Kellermann
e78ab767d3
db/proxy: make connect errors during startup non-fatal
2017-01-23 18:55:40 +01:00
Max Kellermann
f01eb2f95d
db/proxy: improve Connect() error message
2017-01-23 18:55:18 +01:00
Max Kellermann
1450e45d97
Main, db/Glue: improve error messages
2017-01-23 18:52:16 +01:00
Max Kellermann
ec8cba369c
lib/upnp/WorkQueue: disallow copying
2017-01-23 18:35:58 +01:00
Max Kellermann
f4c248f406
lib/upnp/WorkQueue: make constructor explicit
2017-01-23 18:35:47 +01:00
Max Kellermann
f3b2a58646
lib/upnp/WorkQueue: use C++11 initializers
2017-01-23 18:35:22 +01:00
Max Kellermann
c6f89c42b2
db/proxy: make the base class of LibmpdclientError public
...
If the base class is not accessible, the "catching" the base class
won't work. This caused the fatal error:
terminate called after throwing an instance of 'LibmpdclientError'
2017-01-23 18:28:40 +01:00
Max Kellermann
5e93cfdd9e
output/Source: reset the ReplayGain serials ion OpenFilter()
...
Each close/open cycle resets the Filter's state, because a new Filter
instance is being created. That results in the serials
(replay_gain_serial and other_replay_gain_serial) being out of sync
with the internal ReplayGainFilter state.
So instead of initializing those serials once, we need to initialize
them each time we create new ReplayGainFilter instances, i.e. in
OpenFilter().
https://bugs.musicpd.org/view.php?id=4632
2017-01-23 17:55:04 +01:00
Max Kellermann
d91d5a3ab5
playlist/SoundCloud: eliminate unnecessary casted variable
2017-01-20 17:16:11 +01:00
Max Kellermann
df9a665994
pcm/Traits: add "SILENCE" attribute
2017-01-20 15:57:09 +01:00
Max Kellermann
7a098ca0ed
pcm/Traits: add specialization for SampleFormat::DSD
2017-01-20 15:48:30 +01:00
Max Kellermann
33716732a1
pcm/PcmChannels: silence surround channels when converting from stereo
...
Previously, there was no special code to convert stereo to
multi-channel. The generic solution for this was to convert to mono,
and then copy the result to all channels. That's a pretty bad
solution, but at least something which always renders audio. MPD does
something, instead of failing.
Now that MPD has proper support for multi-channel (by defining the
channel order), we can do better than that. It is a (somewhat) common
case to play back stereo music on a DAC which can only do
multi-channel. The best approach here is to copy the stereo channels
to front-left and front-right, and apply the "silence" pattern to all
other channels.
2017-01-19 10:53:41 +01:00
Max Kellermann
97ae594375
DetachedSong: use C++11 initializers
2017-01-18 13:13:36 +01:00
Max Kellermann
3f321ae9a0
pcm/SampleFormat: make the two inline functions "constexpr"
2017-01-17 22:52:09 +01:00
Max Kellermann
161d32a7e7
AudioFormat: update ToString() API documentatio
2017-01-17 22:48:34 +01:00
Max Kellermann
d7137586a9
Audio{Format,Parser}: use shortcuts such as "dsd64" in log messages
2017-01-17 22:42:23 +01:00
Max Kellermann
39114f91a7
AudioFormat: replace struct audio_format_string with class StringBuffer, return it
2017-01-17 22:18:21 +01:00
Max Kellermann
4f01387edf
util/StringBuffer: new utility class
2017-01-17 22:03:42 +01:00
Max Kellermann
de3e0585f1
AudioFormat: move enum SampleFormat to pcm/SampleFormat.hxx
2017-01-17 22:01:01 +01:00
Max Kellermann
6eea56861b
AUTHORS, ...: update my email address
2017-01-17 11:54:55 +01:00
Max Kellermann
dcbab8e37a
PlaylistFile: "playlistadd" creates new playlist if it does not exist, as documented
2017-01-16 20:55:19 +01:00
Max Kellermann
5677278251
CommandLine: update copyright year
2017-01-16 12:04:04 +01:00
Max Kellermann
d14ec6aea5
output/Thread: reconfigure ConvertFilter for its new input AudioFormat
...
If the input AudioFormat changes but the out_audio_format doesn't
change (e.g. because there is a fixed "format" setting in this
"audio_output" section), the ConvertFilter needs to be reconfigured.
This didn't happen, resulting in awful static noise after changing
songs.
2017-01-15 01:24:17 +01:00
Max Kellermann
917cedf893
output/Thread: move AudioFormat logging code around
2017-01-15 01:23:49 +01:00
Max Kellermann
193dd71600
output/Thread: remember the original filter audio format in local variable
2017-01-15 01:21:14 +01:00
Max Kellermann
6c293a3d7f
lib/nfs: add more API documentation
2017-01-15 00:58:49 +01:00
Max Kellermann
e847ddf011
DetachedSong: compare start_time and end_time in IsSame()
...
This method is used by DecoderControl::IsCurrentSong(), which is used
by the player thread to check whether the current decoder instance can
be reused to seek. When switching to another song in the same CUE
sheet, previously DetachedSong::IsSame() returned true, and thus the
old decoder instance was used for the new song, not considering the
new end_time. This led to the old decoder quickly quitting.
2017-01-15 00:54:25 +01:00
Max Kellermann
7e8b448985
input/alsa: set period_size=buffer_size/4
...
This way, we have four periods instead of the default of two. With
only two periods, we don't get woken up often enough, and we
frequently encounter buffer overruns. With four periods, we have more
time to breathe, and the buffer overruns magically disappear.
2017-01-14 21:50:28 +01:00
Max Kellermann
d1f3a87c08
input/alsa: remove the start_threshold setting
...
This setting is mostly useless for capture devices. There's no point
in configuring it.
2017-01-14 21:47:37 +01:00
Max Kellermann
9f8145e590
input/alsa: dump buffer/period sizes
2017-01-14 21:09:57 +01:00
Steven O'Brien
791efc171a
input/alsa: enable non-blocking mode
2017-01-14 20:59:57 +01:00
Steven O'Brien
144312a525
input/alsa: handle EAGAIN
2017-01-14 20:59:23 +01:00
Max Kellermann
92684112ed
input/alsa: call snd_pcm_start() after snd_pcm_prepare()
...
This is necessary because we'll never get woken up again by
epoll_wait() after a buffer overrun recovery, unless we start the PCM
explicitly before returning to the I/O loop.
2017-01-14 20:58:30 +01:00
Max Kellermann
ef114ee6cb
input/alsa: improve logging in Recover()
...
Copy yet more code from the ALSA output plugin.
2017-01-14 20:52:41 +01:00
Max Kellermann
667f209742
input/alsa: check snd_pcm_state() in Recover()
...
Copy some good code from the ALSA output plugin.
2017-01-14 20:51:51 +01:00
Max Kellermann
4ad0747c78
output/alsa: explicitly mention all snd_pcm_state() enums
...
I want a compiler warning when a new state needs to be considered
here.
2017-01-14 20:49:15 +01:00
Max Kellermann
c5cf66402c
input/alsa: make two attributes "const"
2017-01-13 20:26:36 +01:00
Max Kellermann
05417049eb
input/alsa: clear sockets from within IOThread
...
Fixes assertion failure in implicit destructor.
2017-01-13 20:17:16 +01:00
Max Kellermann
c7b0c46d9f
output/recorder: fix typo in variable name
...
Fixes the dreaded error "Failed to create : No such file or
directory".
https://bugs.musicpd.org/view.php?id=4625
2017-01-12 21:36:32 +01:00
Max Kellermann
df578c91ad
output/alsa: log DoP mode
2017-01-11 22:50:40 +01:00
Max Kellermann
70008c47c9
output/alsa: support DSD_U16
2017-01-11 22:47:21 +01:00
Max Kellermann
938affef32
pcm/export: support DSD_U16
2017-01-11 22:47:12 +01:00
Max Kellermann
a3c33000ee
pcm/Dsd32: include cleanup
2017-01-11 22:47:12 +01:00
Max Kellermann
cc0dbcf3f4
pcm/Dsd32: fix the byte order
...
The byte order of DSD_U32 was wrong from the start. The oldest bits
must be in the MSB, not in the LSB, according to
snd_pcm_format_descriptions in alsa-lib.
2017-01-11 22:25:54 +01:00
Max Kellermann
c5a2cadccc
pcm/Export: convert to class, make members private
2017-01-11 21:48:43 +01:00
Max Kellermann
9aa43416b6
pcm/dop: remove unnecessary assertions
2017-01-11 21:48:43 +01:00
Max Kellermann
8364029db8
output/alsa: move code to PlayRaw()
2017-01-11 21:38:05 +01:00
Max Kellermann
d842d21be0
util/ReusableArray: add method GetCapacity()
2017-01-11 20:37:12 +01:00
Max Kellermann
3514fd2433
util/ReusableArray: add move constructor/operator
2017-01-11 20:37:12 +01:00
Max Kellermann
6778ff27ea
util/ReusableArray: use C++11 initializers
2017-01-11 20:33:01 +01:00
Max Kellermann
f32315d699
pcm/Export: remove obsolete gcc warning suppression
2017-01-11 20:31:48 +01:00
Max Kellermann
8b754b24b6
pcm/Buffer: update API documentation
2017-01-11 20:24:32 +01:00
Max Kellermann
78a73eac53
pcm/Export: add (dummy) method Cancel()
...
We'll have some code for it soon.
2017-01-11 15:41:28 +01:00
Max Kellermann
533cb99c33
output/Source: reset all filters in Cancel()
2017-01-11 15:39:18 +01:00
Max Kellermann
79726940dc
output/Source: un-inline Cancel()
2017-01-11 15:39:00 +01:00
Max Kellermann
27c7891169
filter/Internal: add method Reset()
2017-01-11 15:34:25 +01:00
Max Kellermann
7a3a793a12
decoder/Bridge: call PcmConvert::Reset() after seeking
2017-01-11 15:32:57 +01:00
Max Kellermann
8088469eca
pcm/Convert: add method Reset()
2017-01-11 15:30:30 +01:00
Max Kellermann
3dcb082015
pcm/Resampler: add method Reset()
...
Hook for src_reset(), not yet used.
2017-01-11 15:26:48 +01:00
Max Kellermann
bece023028
pcm/PcmDsd: move Dsd8To32() to Dsd32.cxx
2017-01-11 15:22:43 +01:00
Max Kellermann
9c4df66925
pcm/Export: halve the sample rate for DoP
...
Move this sample rate fixup from the ALSA output plugin to PcmExport,
where it belongs.
2017-01-11 10:33:23 +01:00
Max Kellermann
2b43ceb6c6
pcm/Export: DSD_U32 quarters the sample rate
...
DSD_U32 packs four bytes instead of one large "sample", thus the
sample rate is one quarter of the input sample rate. This fixes a
rather critical DSD_U32 playback problem.
2017-01-11 10:14:41 +01:00
Max Kellermann
c143adba91
pcm/Export: add CalcOutputSampleRate(), CalcInputSampleRate()
...
Prepare for DSD sample rate fixups.
2017-01-10 23:48:26 +01:00
Max Kellermann
142fdc8d86
decoder/flac: add options "probesize" and "analyzeduration"
...
https://bugs.musicpd.org/view.php?id=3876
2017-01-10 23:05:04 +01:00
Max Kellermann
c3fc84de12
input/curl: wake up client thread after seek to end of file
...
Call SeekDone() to avoid the freeze bug.
2017-01-09 18:08:33 +01:00
Max Kellermann
c82b03a74c
decoder/wavpack: fix crash bug
2017-01-08 14:54:12 +01:00
Max Kellermann
58fb36bdb9
storage/http: new storage plugin
2017-01-08 14:40:20 +01:00
Max Kellermann
4297a7b0a4
lib/curl/Request: move exception handling out of the WRITEFUNCTION
...
libcurl's WRITEFUNCTION is pretty fragile; if we destroy the CURL*
instance or even unregister it using curl_multi_remove_handle(),
libcurl will crash instantly. But still we need to be able to handle
exceptions from inside the WRITEFUNCTION, and call
CurlResponseHandler::OnError(), which may destroy the whole thing. As
a workaround, I use DeferredMonitor to postpone the OnError() call
into a stack frame which is allowed to destroy the request.
2017-01-08 14:36:27 +01:00