Commit Graph

9909 Commits

Author SHA1 Message Date
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 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
Max Kellermann ceba6816de output/Thread: split Open()
Simplify the code, eliminate duplicate rollback code and eliminate the
"goto" kludge.
2016-12-13 21:46:27 +01:00
Max Kellermann 093cb475bb output/Thread: simplify the retry_audio_format declaration 2016-12-13 21:34:43 +01:00
Max Kellermann d44790b35f output/Thread: reduce locking further in Open() 2016-12-13 21:26:28 +01:00
Max Kellermann f8164a3dd1 output/Thread: unlock mutex during OpenFilter() 2016-12-13 21:24:14 +01:00
Max Kellermann c20126598f output/Thread: remove unused variable 2016-12-13 21:24:05 +01:00
Max Kellermann 6c818bb37a AudioFormat: add method WithMask(), shortcut for ApplyMask() 2016-12-13 20:57:46 +01:00
Max Kellermann df91f3738a output/Thread: remove a useless out_audio_format setting
Now that I can see the Reopen() method clearly, it is obvious that the
out_audio_format setting will get overwritten by the following Open()
call.
2016-12-13 20:43:29 +01:00
Max Kellermann b5b268f606 output/Thread: remove another redundant "open" check 2016-12-13 20:41:54 +01:00
Max Kellermann ce6b8c94a2 output/Thread: convert redundant runtime check to assertion 2016-12-13 20:29:16 +01:00
Max Kellermann 6e643fe58b output/Thread: don't deinitialize the pipe in Close() 2016-12-13 20:28:19 +01:00
Max Kellermann 2bf91a0487 output/Internal: merge REOPEN and OPEN 2016-12-13 20:07:00 +01:00
Max Kellermann 2775d747ac output/Thread: move MusicPipe code to class SharedPipeConsumer 2016-12-13 16:33:23 +01:00
Max Kellermann 99659e4cf9 release v0.19.21
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlhPxTwQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEoR8EACnEBj1zPTiraIoDZi9ZyqvwHZWILdcHRID
 8XdUWmgIAwbL83Fwzxfokl060TWa43DWTWtGvieWkMcaAaTYNf8wxH6KZFmEVPCe
 cvveFM6/PXJuEED16QjGoII9OzlIH330C4mmcmsfLPrcbAfULx7OtF7neIfbgpPX
 ZKgrO6HVbpsMH57+o1CnX6sZXHwW9EvUy0j4YRuSfGX/7pgItfBrypDqPJCv2Hy1
 mDy6gKWr7psA5ZiwYfTWVU1SPBuJiaKEM2jU80A5XVN0eZOi1EtUeySpyQO8Uncu
 hnJApi9Pd6IT9Tb4Wz7LshmqHCjG82KC+EppI4ESrqE3R/OEsho1iPFej4SdJycV
 XIcIRJ/S2JeopgGo4k/vlVzf4Y/9CMZZ7nP4fG1/1yjIYFQbefJeo1Gp/8b5ZTRD
 5PjFgNGFyClwXNsHesF/2wDlCs1/DTv51BnapVLKD6AO9uyAOrzxBSeg8qSuprXx
 K5m/z2dMdUNjBDzrSBzxKtVBwPfuARuo4Q633AxBk5C+HRpSdirtgrDBgE2aTDfU
 4o+BjrhiL60t1C5iQJ48ahzCIRkEfe0czmfeNxu5Jiig8Y9cYtkYJezniyBIGkbL
 RpqPxnD0YFTzzvuP8dWP+3zarxelETDwnH8KxD5jLpy2Rf2qjoNbeJNd70N6e8nN
 z7Hnvp4YwQ==
 =qsCR
 -----END PGP SIGNATURE-----

Merge tag 'v0.19.21'

release v0.19.21
2016-12-13 11:00:39 +01:00
Max Kellermann 7146f825b2 decoder/ffmpeg: fix double free bug
From the avformat_open_input() API documentation:

 "Note that a user-supplied AVFormatContext will be freed on failure."

https://bugs.musicpd.org/view.php?id=4607
2016-12-13 08:34:05 +01:00
Max Kellermann dc05dd7ca1 output/Multiple: make chunk_is_consumed_in() an AudioOutput method 2016-12-11 21:59:28 +01:00
Max Kellermann 57dd344f3b decoder/wavpack: implement WavpackStreamReader64 if available 2016-12-10 00:24:54 +01:00
Max Kellermann f7f59df8aa decoder/wavpack: move code to WavpackInput methods 2016-12-10 00:17:46 +01:00
Max Kellermann 0525a6f90f decoder/wavpack: use WavpackSeekSample64() if available 2016-12-10 00:12:47 +01:00
Max Kellermann 7b4305d81b decoder/wavpack: seek errors are fatal
The libWavPack documentation says:

 "After a FALSE return the file should not be accessed again (other
 than to close it); this is a fatal error."
2016-12-10 00:11:29 +01:00
Max Kellermann 94e9e93fa4 ReplayGainGlobal: move replay_gain_config into struct Config
Yet another global variable removed.
2016-12-10 00:03:29 +01:00
Max Kellermann d2a1294e9a Main: add struct Config, empty currently 2016-12-10 00:00:50 +01:00
Max Kellermann 30bd190b41 decoder/wavpack: implement scan_stream() 2016-12-09 23:23:35 +01:00
Max Kellermann cf93cd9307 decoder/wavpack: convert WavpackInput::client to pointer 2016-12-09 23:23:02 +01:00
Max Kellermann f40816e063 decoder/wavpack: add WavpackOpen() wrappers which throw exception 2016-12-09 23:15:40 +01:00
Max Kellermann 3759f29852 decoder/wavpack: move wavpack_scan_file() down 2016-12-09 23:15:06 +01:00
Max Kellermann bc5555933f decoder/wavpack: support native DSD 2016-12-09 23:08:54 +01:00
Max Kellermann ead7ae8504 decoder/wavpack: use template for format_sample_X() 2016-12-09 22:53:01 +01:00
Max Kellermann ad5abba8c6 decoder/wavpack: move 8 and 16 bit conversion to separate functions 2016-12-09 22:49:07 +01:00
Max Kellermann 61296cedd2 decoder/wavpack: rename format_samples_float() to format_samples_nop() 2016-12-09 22:47:32 +01:00
Max Kellermann d9c29a2c4f decoder/wavpack: use std::copy_n() 2016-12-09 22:23:19 +01:00
Max Kellermann f5172e6b84 decoder/wavpack: use int16_t instead of uint16_t
Technically, these samples are signed.  There was no practical
difference, only the declaration was formally wrong.
2016-12-09 22:21:31 +01:00
Max Kellermann 544bcbe903 decoder/wavpack: use WavpackGetNumSamples64() if available 2016-12-09 22:09:32 +01:00
Max Kellermann f35dab1b56 decoder/wavpack: check WavpackGetNumSamples()==-1 2016-12-09 21:46:29 +01:00
Max Kellermann caee420087 decoder/wavpack: move code to GetDuration() 2016-12-09 21:45:22 +01:00
Max Kellermann e8c374113e decoder/wavpack: make is_float const 2016-12-09 21:30:31 +01:00
Max Kellermann 98a241a730 decoder/wavpack: use WavpackGetReducedChannels()
Since we don't use OPEN_2CH_MAX, this should be equal to
WavpackGetNumChannels() - but who knows, maybe a future libWavPack
version breaks this assumption.
2016-12-09 21:23:38 +01:00
Max Kellermann be8297d6f6 decoder/wavpack: basic DSD support (WavPack 5)
Enable OPEN_DSD_AS_PCM if available.  No OPEN_DSD_NATIVE yet.

 https://bugs.musicpd.org/view.php?id=4606
2016-12-09 21:03:47 +01:00
Max Kellermann 09da80e9f4 tag/ApeTag: don't export ape_tags[] 2016-12-09 20:59:07 +01:00
Max Kellermann df4ecf63a8 decoder/wavpack: disable OPEN_TAGS
Use MPD's internal APE tag code, which works just as well.  This
removes some duplicate code for reading tags and ReplayGain.
2016-12-09 20:53:54 +01:00
Max Kellermann b4d1937857 decoder/wavpack: change norm_offset to 0
MPD uses a floating point range from -1 to +1 internally - why ask
libwavpack to use -32768..+32768 only to reduce it back to -1..+1
afterwards?
2016-12-09 20:53:45 +01:00
Max Kellermann 0be5fbdc35 decoder/wavpack: use AtScopeExit() 2016-12-09 20:53:04 +01:00
Max Kellermann ae7e25ea65 release v0.19.20
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlhLAzUQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEp8ED/92V7el1LsuifbIKP4xFmHfENxB5bzBCQHZ
 f4DlGybr7pA4FZQIR5Z0qulvVr+sdY0Y8hgSoOCKzmHGuOgQ6zxHVGVMWLY5N0JN
 ExOrSGUhIjNV+L06LA/YDOE4Z9VUuSi6ZLx1KSLvFbYWULmoqoQREo001YyrfmYr
 pSq+MosGX7i/lFEOrOzw1keEnOUIlqoEJ8IpPks+Xtkk8159TJS2z2FsgWBnlG5W
 qO/N/Nn+TBZZjsDkOoJcdsQ6ot1ThJgxMWY+fduNP5Fe8s2oCHc8dAdYMyfhQiky
 0xq139T8tLRRJUkv9inK63Zd0sn06/pemDD+XZGNE6arwvTsqriEwPcJHgsJYfaQ
 wqGWv+DrMTGVSZnH+XUACLpUexmd8M6q1MZ3g12tRjQHNM06Yn6PePdHUm4IuclJ
 eGsXEb1+jgr6/tMxYkmjUIs8SacpTK2ZUx4aYIG7+tVNmfGompK1gYlYT86ZVEEh
 byzy7A67C9BpSkuC/4YzXT/oHBpDf7T4WVz1TEKZT3vke6l0CDTwYCQyBcG0NFCe
 Pic45q4RgLbkH6NR4bJ1oX/XRCgh8V2QkLKdgcpzS4Lv+TE2hHRlBf9a7SVufIPT
 yBNlY91nT8zUfws/7LBwfZtYQB7VcudUMlmSigtlrvr9CvpRCuGCCY5vdLxi4LYz
 3lm6wOrp5g==
 =opJg
 -----END PGP SIGNATURE-----

Merge tag 'v0.19.20'

release v0.19.20
2016-12-09 20:18:54 +01:00
Max Kellermann e7353ec7e7 Queue: "setprio" re-enqueues old song if priority has been raised
This commit changes a minor queue priority design to something which
makes a little bit more sense.

Previously, a song that had already been played would only be
re-enqueued if its priority had just been raised above the current
song's.  This means that if it was already above, it was not
re-enqueued.  That is a surprising behavior, because users expect a
song to be played when its priority is raised.

Now the song is always re-enqueued if its priority is raised (and
above the current song's - no matter if it has already been above
before).

 https://bugs.musicpd.org/view.php?id=4592
2016-12-09 13:02:26 +01:00
Max Kellermann 5013de6770 LogInit: convert use_stdout flag to out_fd=STDOUT_FILENO 2016-12-04 20:15:45 +01:00
Max Kellermann 301abac0c1 LogInit: initialize out_fd properly to avoid closing stdin 2016-12-04 20:13:37 +01:00
Max Kellermann 9614c48e4c LogInit: throw exception instead of calling FatalError() 2016-12-04 20:07:41 +01:00
Max Kellermann c6e1ca1c22 system/Error: use std::generic_category() for errno on Windows
It's wrong to use std::system_category() for both GetLastError() and
errno on Windows.  Apparently, everybody uses std::generic_category()
for errno values, which appears to be a safe choice.

Some discussion on this confusing topic can be found here:

 https://stackoverflow.com/questions/28746372/system-error-categories-and-standard-system-error-codes
2016-12-04 20:07:11 +01:00
Max Kellermann 30dc473697 system/Error: allow using errno functions on Windows
The Windows standard library emulates part of POSIX, which includes
errno.
2016-12-04 20:07:09 +01:00
Max Kellermann 65974ceabc PlaylistFile: remove redundant existence check 2016-12-04 20:04:16 +01:00
Max Kellermann 6caf53d1c2 fs/FileSystem: RenameFile() throws exception on error 2016-12-04 19:59:33 +01:00
Max Kellermann dee6e498d9 fs/CheckFile: use IsAccessDenied() 2016-12-04 19:56:25 +01:00
Max Kellermann b3723274f7 decoder/Bridge: move code to DecoderControl::SetReady() 2016-12-03 14:20:51 +01:00
Max Kellermann 9fb7cc796b decoder/Control: add attribute configured_audio_format
Obsoletes the same variable from AudioConfig.cxx.
2016-12-03 14:12:08 +01:00
Max Kellermann 3472208c05 ReplayGainGlobal: move replay_gain_mode to struct Partition 2016-12-03 13:56:25 +01:00
Max Kellermann fc30e1d559 Partition: pass ReplayGainConfig to constructor 2016-12-03 13:55:14 +01:00
Max Kellermann cd4bb444ff player/Control: make ReplayGainConfig const 2016-12-03 13:47:13 +01:00
Max Kellermann e443513996 Main: call replay_gain_global_init() before forking 2016-12-03 13:27:59 +01:00
Max Kellermann 3d16f22135 player/Control: use C++11 initializers 2016-12-03 13:08:00 +01:00
Max Kellermann 6cc1ff5eeb decoder/Control: make ReplayGainConfig const 2016-12-03 13:05:25 +01:00
Max Kellermann 3000b9dcde filter/ReplayGain: add ReplayGainConfig copy
Remove dependency on ReplayGain global variables.
2016-12-03 12:51:02 +01:00
Max Kellermann 3b867462a3 filter/ReplayGain: remove FilterPlugin instance, add explicit constructor 2016-12-03 12:34:23 +01:00
Max Kellermann b8aa9348b9 filter/Registry: make filter_plugins static 2016-12-03 12:24:30 +01:00
Max Kellermann 513e3a3d21 filter/ReplayGain: forward-declare struct ReplayGainInfo 2016-12-03 12:20:32 +01:00
Max Kellermann bfb0897b54 filter/ReplayGain: convert pointers to references 2016-12-03 12:13:45 +01:00
Max Kellermann 86e8b8c10d decoder/Thread: skip the ReplayGain loader if the feature is disabled
https://bugs.musicpd.org/view.php?id=4595
2016-11-25 13:26:40 +01:00
Max Kellermann ee57c3490a {decoder,player}/Control: add ReplayGain{Config,Mode} attributes
Don't use the global variables in class DecoderBridge; instead,
forward these values to the decoder thread via PlayerControl and
DecoderControl.
2016-11-25 12:51:55 +01:00
Max Kellermann 77c1f54876 ReplayGainConfig: add struct ReplayGainConfig, move globals to ReplayGainGlobal.cxx 2016-11-25 11:13:08 +01:00
Max Kellermann dc5984d0e0 ReplayGainConfig: move code to ParsePreamp() 2016-11-24 17:45:27 +01:00
Max Kellermann 7afbd4800f filter/ReplayGain: use ToString(ReplayGainMode) 2016-11-24 17:39:00 +01:00
Max Kellermann 0720702c91 ReplayGainMode: add ToString(), FromString()
Move code from ReplayGainConfig.cxx.
2016-11-24 17:34:57 +01:00
Max Kellermann 5f396e824f ReplayGainMode: convert to strictly-typed enum 2016-11-24 17:34:57 +01:00
Max Kellermann 4f229c254c ReplayGainInfo: move enum ReplayGainMode to separate header 2016-11-24 17:34:57 +01:00
Max Kellermann 25e58df5e0 ReplayGainInfo: don't use array in struct ReplayGainInfo
Declare two named elements.  An enum should not be used as an array
index, as this is error prone.
2016-11-24 17:34:57 +01:00
Max Kellermann 1261327fa6 ReplayGainInfo: implement fallback in Get()
Eliminates Complete().
2016-11-24 17:34:57 +01:00
Max Kellermann 09c3cc58e4 ReplayGainInfo: add method Get() 2016-11-24 17:34:57 +01:00
Max Kellermann 7ef31f84a7 command/Error: translate std::invalid_argument to ACK_ERROR_ARG 2016-11-24 17:33:36 +01:00
Max Kellermann 0759d72108 Partition: add UpdateEffectiveReplayGainMode()
Move code from replay_gain_get_real_mode().
2016-11-24 15:18:57 +01:00
Max Kellermann 9b9144f25d decoder/Control: use C++11 initializers 2016-11-24 14:58:17 +01:00
Max Kellermann b677e891b4 decoder/{mikmod,modplug}: throw exception instead of calling FatalError() 2016-11-24 14:09:58 +01:00
Max Kellermann 509f62f68d output/MultipleOutputs: throw exception instead of calling FatalError() 2016-11-24 14:04:40 +01:00
Max Kellermann 868bf752f3 MusicPipe: disallow copying 2016-11-23 18:06:15 +01:00
Max Kellermann 051cdc9670 MusicPipe: use C++11 initializers 2016-11-23 18:04:23 +01:00
Max Kellermann 4de5c216ff MusicChunk: disallow copying 2016-11-23 17:57:29 +01:00
Max Kellermann ad2c7304ea MusicChunk: use C++11 initializers 2016-11-23 17:56:36 +01:00
Max Kellermann 4dd1309c3f filter/Plugin: rename with CamelCase 2016-11-23 17:43:50 +01:00
Steven OBrien 541da2740d db/simple: add missing "return"
SimpleDatabase::Visit() always throws exception when visiting a song.
Adding a song to the queue always results in a "No such directory"
error response, although the song is successfully added.  This
behaviour was introduced by commit
3ff728ab02.  This patch fixes this.

https://bugs.musicpd.org/view.php?id=4601
2016-11-23 17:30:30 +01:00
Max Kellermann 95e2bec215 decoder/DecoderPlugin: container_scan() returns forward_list<DetachedSong>
Speed up container_scan() again, by eliminating the need to call
scan_file() for each item.
2016-11-22 16:49:31 +01:00
Max Kellermann 72c96052b4 decoder/gme: move gme_container_scan() down 2016-11-22 16:49:30 +01:00
Max Kellermann bf78b7f815 decoder/sidplay: use template to eliminate duplicate code 2016-11-22 13:17:31 +01:00
Max Kellermann ffb9874d84 decoder/sidplay: move code to ScanSidTuneInfo() 2016-11-22 12:37:25 +01:00
Max Kellermann 228cdbe6af decoder/gme: provide the TRACK tag 2016-11-22 12:20:31 +01:00
Max Kellermann a303639c9e decoder/{gme,sidplay}: fix off-by-one bug in container_scan()
Broken by commit 0abee77e62
2016-11-22 12:20:31 +01:00
Max Kellermann c5133f6088 db/update/Container: catch C++ exceptions 2016-11-22 12:16:14 +01:00
Max Kellermann 27d368d48d decoder/gme: use AtScopeExit() 2016-11-22 12:16:14 +01:00
Max Kellermann 085b599f84 decoder/gme: remove redundant extern declaration 2016-11-22 12:16:14 +01:00
Max Kellermann 3b84eb3b70 decoder/gme: add missing SUBTUNE_PREFIX
Got lost in 0abee77e62
2016-11-22 12:16:14 +01:00
Max Kellermann aa877a29d7 decoder/Thread: repair container decoder support
Catch ENOTDIR exceptions and in that case, try all matching decoder
plugins which implement the "container_scan" method.

 https://bugs.musicpd.org/view.php?id=4561
2016-11-22 10:24:08 +01:00
Max Kellermann 0abee77e62 decoder/DecoderPlugin: container_scan() returns forward_list<string> 2016-11-22 09:33:52 +01:00
Max Kellermann 114fcee2ae decoder/Client: add virtual method Read() 2016-11-21 22:43:09 +01:00
Max Kellermann b488204093 decoder/API: move DecoderBridge methods to Bridge.cxx 2016-11-21 22:14:09 +01:00
Max Kellermann 322bfbaf57 decoder/API: simplify the client==nullptr code path in decoder_read() 2016-11-21 22:13:03 +01:00
Max Kellermann 2718f4c333 decoder/API: move part of decoder_check_cancel_read() into class DecoderBridge 2016-11-21 22:07:03 +01:00
Max Kellermann 8c342a764b decoder/API: move functions into class DecoderBridge 2016-11-21 21:44:57 +01:00
Max Kellermann 697c3f8cb9 decoder/Internal: rename struct Decoder to class DecoderBridge 2016-11-21 21:38:23 +01:00
Max Kellermann 723e54f74e decoder/Client: add OpenUri(), replacing decoder_open_uri() 2016-11-18 12:34:04 +01:00
Max Kellermann 1a8c96a3f0 decoder/mpcdec: use AtScopeExit() 2016-11-18 12:22:41 +01:00
Max Kellermann a88040e4d5 decoder/Client: add Submit methods
Replaces decoder_data() and others.
2016-11-18 09:05:04 +01:00
Max Kellermann 47a0f46ce8 decoder/Client: add DecoderCommand/seek virtual methods 2016-11-18 09:03:42 +01:00
Max Kellermann 66fb352cca decoder/Client: add virtual method Ready()
Replaces decoder_initialized().
2016-11-18 09:03:41 +01:00
Max Kellermann fd77acc217 decoder/Client: new interface which wraps struct Decoder
Prepare for a Decoder API redesign based on an abstract class with
virtual methods.
2016-11-18 09:03:39 +01:00
Max Kellermann 595d1942cb decoder/Internal: rename "chunk" to "current_chunk" 2016-11-18 09:01:32 +01:00
Max Kellermann 219a756abc Compiler.h: drop gcc_alignas(), use plain C++11 alignas() 2016-11-18 08:56:16 +01:00
Max Kellermann 2f76f9da89 configure.ac: enable C++14 2016-11-18 08:41:47 +01:00
Max Kellermann b0b8f573bc decoder/API: copy exceptions to Decoder::error 2016-11-17 22:54:13 +01:00
Max Kellermann 746aa6cc0f decoder/API: check for errors in decoder_read() 2016-11-17 22:53:43 +01:00
Max Kellermann fac610d47b decoder/API: decoder_open_uri() can throw StopDecoder 2016-11-17 22:48:18 +01:00
Max Kellermann 93209da176 decoder/API: lock decoder in decoder_get_command() 2016-11-17 22:36:42 +01:00
Max Kellermann 35a2a48c47 Merge branch 'v0.19.x' 2016-11-17 22:20:24 +01:00
Max Kellermann 7019f6bea4 decoder/pcm: round buffer size down to nearest frame size
https://bugs.musicpd.org/view.php?id=4599
2016-11-17 21:58:27 +01:00
Max Kellermann 5c3e55b5b1 {input,output}/alsa: fix gcc 7.0 -Wimplicit-fallthrough 2016-11-16 19:50:38 +01:00
Max Kellermann 22dcca9832 util/Error: remove obsolete class 2016-11-10 12:58:26 +01:00
Max Kellermann a17abc5557 Log: remove the obsolete class Error overloads 2016-11-10 12:55:08 +01:00
Max Kellermann 741c6f1179 command: remove the obsolete Error support code 2016-11-10 12:55:08 +01:00
Max Kellermann 43b285ef7a decoder/Thread: remove the obsolete catch(Error&) 2016-11-10 12:55:08 +01:00
Max Kellermann f4bb18b05e fs/AllocatedPath: remove the obsolete class Error overload 2016-11-10 12:55:08 +01:00
Max Kellermann 14885f25b4 system/FatalError: remove the obsolete class Error overloads 2016-11-10 12:55:08 +01:00
Max Kellermann 4e16ea0f0a decoder/flac: migrate from class Error to C++ exceptions 2016-11-10 12:55:08 +01:00
Max Kellermann 42a696873b decoder/faad: migrate from class Error to C++ exceptions 2016-11-10 12:55:08 +01:00
Max Kellermann cfd51db229 CheckAudioFormat: migrate from class Error to C++ exceptions 2016-11-10 12:55:08 +01:00
Max Kellermann 12f11c97ae decoder/faad: use AtScopeExit() 2016-11-10 12:55:08 +01:00
Max Kellermann 6a78d11127 decoder/gme: use AtScopeExit() 2016-11-10 12:55:08 +01:00
Max Kellermann 256ee7a8c7 decoder/audiofile: use AtScopeExit() 2016-11-10 12:55:08 +01:00
Max Kellermann 07a51957ee fs/FileInfo: remove the obsolete class Error overloads 2016-11-10 12:55:08 +01:00
Max Kellermann 37c4470f10 fs/CheckFile: use FileInfo(Path) instead of GetFileInfo() 2016-11-10 12:55:08 +01:00
Max Kellermann 4dc7d1c0cd decoder/Thread: use AllocatedPath::FromUTF8Throw() 2016-11-10 12:55:08 +01:00
Dave Hocker f6a85f0b0b output/osx: fix build failure 2016-11-10 12:55:08 +01:00
Max Kellermann 5b8b660bd0 decoder/DecoderAPI: include cleanup 2016-11-09 13:42:52 +01:00
Max Kellermann d9cb85df83 output/Plugin: remove 'Error&' parameters, use C++ exceptions only 2016-11-09 12:36:21 +01:00
Max Kellermann 445e82be75 output/Multiple: migrate from class Error to C++ exceptions 2016-11-09 12:31:23 +01:00
Max Kellermann 98a12c49dd pcm/Domain: remove obsolete source 2016-11-09 12:15:35 +01:00
Max Kellermann b78cc7e48a output/Thread: remove obsolete pcm_domain check, this is defunct 2016-11-09 12:15:35 +01:00
Max Kellermann ac9ce0b3ad output/Init: migrate _setup() from class Error to C++ exceptions 2016-11-09 12:09:00 +01:00
Max Kellermann cf2b814629 output/Init: migrate Configure() from class Error to C++ exceptions 2016-11-09 12:06:54 +01:00
Max Kellermann bbe7a37359 output/Internal: hide Configure() and remove the non-configuring constructor 2016-11-09 12:06:06 +01:00
Max Kellermann d0aa154ea6 output/null: migrate from class Error to C++ exceptions 2016-11-09 12:03:20 +01:00
Max Kellermann df4616ae4a output/osx: migrate from class Error to C++ exceptions
Beware, this commit was not tested.  I don't have OS X, but I want to
prepare an API change.
2016-11-09 11:51:28 +01:00
Max Kellermann 10f62db9fd output/osx: use std::unique_ptr
Eliminate all those "goto"s and make the function exception-safe.
2016-11-09 11:50:14 +01:00
Max Kellermann 5c075210d6 output/osx: use AtScopeExit() to call CFRelease() 2016-11-09 11:49:21 +01:00
Max Kellermann 0cf85b0771 output/haiku: eliminate DoClose() 2016-11-09 11:42:00 +01:00
Max Kellermann fa90047e52 output/haiku: migrate from class Error to C++ exceptions
Beware, this commit was not tested.  I don't have Haiku, but I want to
prepare an API change.
2016-11-09 11:39:11 +01:00
Max Kellermann b9f64fe19b output/haiku: embed "format" into the HaikuOutput class
Avoid one level of dynamic allocation.
2016-11-09 11:36:38 +01:00
Max Kellermann dd072912e8 output/solaris: migrate from class Error to C++ exceptions 2016-11-09 11:18:19 +01:00
Max Kellermann 9dbdc75689 output/httpd: migrate from class Error to C++ exceptions 2016-11-09 08:40:10 +01:00
Max Kellermann dce211dbba output/sles: migrate from class Error to C++ exceptions 2016-11-09 08:35:35 +01:00
Max Kellermann b4e5fa5c1b output/roar: migrate from class Error to C++ exceptions 2016-11-09 08:29:44 +01:00
Max Kellermann f12fa7e20a output/shout: migrate from class Error to C++ exceptions 2016-11-08 15:40:19 +01:00
Max Kellermann 96f8f1da0c output/OpenAL: migrate from class Error to C++ exceptions 2016-11-08 15:19:30 +01:00
Max Kellermann db7eec042e output/sndio: migrate from class Error to C++ exceptions 2016-11-08 15:15:16 +01:00
Max Kellermann 52aed3f8a1 output/jack: migrate from class Error to C++ exceptions 2016-11-08 15:11:21 +01:00
Max Kellermann cadd186f1b output/jack: use AtScopeExit() 2016-11-08 15:10:38 +01:00
Max Kellermann dd9ab16d67 output/recorder: migrate from class Error to C++ exceptions 2016-11-07 09:48:10 +01:00
Max Kellermann d8b6aff23a encoder: migrate from class Error to C++ exceptions 2016-11-07 09:25:51 +01:00
Max Kellermann b8aac3f8fc output/Thread: catch and log send_tag() exceptions 2016-11-07 09:25:47 +01:00
Max Kellermann 4aab97ccb1 config/Path: throw std::runtime_error on error 2016-11-07 09:07:50 +01:00
Max Kellermann 4cd21f1e07 decoder/Control: throw exception on Seek() error 2016-11-07 09:05:28 +01:00
Max Kellermann 403f0f8c64 SongLoader, ...: include cleanup 2016-11-07 09:01:57 +01:00
Max Kellermann 8c4246f2ad net/SocketError: remove obsolete Error functions 2016-11-07 08:58:26 +01:00
Max Kellermann 1859ba5ec8 output/winmm: 8 bit playback is not supported
Everything must be S16.
2016-11-07 08:53:57 +01:00
Max Kellermann 54d5184255 output/winmm: use std::array 2016-11-07 08:50:58 +01:00
Max Kellermann 0c5b986fc4 output/winmm: use range-based "for" 2016-11-07 08:28:41 +01:00
Max Kellermann 7b2cdd618e output/winmm: use AudioOutputWrapper 2016-11-07 08:08:42 +01:00
Max Kellermann 30bb3f1fcb output/winmm: migrate from class Error to C++ exceptions 2016-11-07 07:42:18 +01:00
Max Kellermann b45ea66175 output/pipe: migrate from class Error to C++ exceptions 2016-11-05 15:24:10 +01:00
Max Kellermann 543c5034af output/fifo: migrate from class Error to C++ exceptions 2016-11-05 15:13:14 +01:00
Max Kellermann c8aa7afdc6 output/oss: migrate from class Error to C++ exceptions 2016-11-05 13:18:45 +01:00
Max Kellermann b35bb1b50c output/alsa: use C++ initializers 2016-11-04 11:31:23 +01:00
Max Kellermann 6341be9cdf output/alsa: migrate from class Error to C++ exceptions 2016-11-04 11:31:23 +01:00
Max Kellermann 93a14a93f9 output/alsa: use Error::FormatPrefix() 2016-11-04 11:31:23 +01:00
Max Kellermann d6559e2ac9 output/Thread: fix wrong error reference in catch clause 2016-11-04 11:31:23 +01:00
Max Kellermann 65e6755b8b output/ao: migrate from class Error to C++ exceptions 2016-11-02 12:36:13 +01:00
Max Kellermann 6ead9750f4 output/pulse: migrate from class Error to C++ exceptions 2016-11-02 11:01:22 +01:00
Max Kellermann 6532c7e089 output/pulse: use C++11 initializers 2016-11-02 11:01:07 +01:00
Max Kellermann 8b3d934230 output/Thread: catch Pause() exceptions 2016-11-02 10:53:43 +01:00
Max Kellermann e2b7c30811 event/BufferedSocket: pass std::exception_ptr to OnSocketError() 2016-11-02 10:38:05 +01:00
Max Kellermann c8bb3c0b71 CommandLine: migrate from class Error to C++ exceptions 2016-11-02 10:30:46 +01:00
Max Kellermann 9990e8473c LogInit: migrate from class Error to C++ exceptions 2016-11-02 10:11:17 +01:00
Max Kellermann d765182bbb config/Global: _get_path() throws exception on error 2016-11-02 10:07:57 +01:00
Max Kellermann 5a63d1d5a4 LogInit: use ConfigParam::GetPath() 2016-11-02 10:07:50 +01:00
Max Kellermann 6d409d27ca lib/icu: migrate from class Error to C++ exceptions 2016-11-02 09:54:13 +01:00
Max Kellermann e9c2885f34 lib/ffmpeg/Error: remove SetFfmpegError(); it's unused now 2016-10-31 13:18:47 +01:00
Max Kellermann ecb8f7362b decoder/ffmpeg: copy_interleave_frame() throws exception on error 2016-10-31 13:03:02 +01:00
Max Kellermann 17ccfec358 lib/expat/Parser: remove unused method SetError() 2016-10-29 11:06:28 +02:00
Max Kellermann a55bb28069 decoder: include cleanup 2016-10-29 11:04:49 +02:00
Max Kellermann a2e3dc0592 db/Interface: migrate Update() from class Error to C++ exceptions 2016-10-29 10:59:18 +02:00
Max Kellermann df142d4f61 db/simple: migrate Mount() from class Error to C++ exceptions 2016-10-29 10:56:31 +02:00
Max Kellermann fac8edd47a db/Interface: migrate visitor methods from class Error to C++ exceptions 2016-10-29 10:42:56 +02:00
Max Kellermann 9a9da7b077 command/Database: use std::unique_ptr 2016-10-29 10:42:56 +02:00
Max Kellermann 131441846b db/Error: remove unused variable db_domain 2016-10-29 10:42:56 +02:00
Max Kellermann 3ff728ab02 db/Visitor: remove the Error parameter
Implementations shall use exceptions instead.
2016-10-29 10:04:43 +02:00
Max Kellermann 78bf4ef5fa db/Configured: migrate from class Error to C++ exceptions 2016-10-29 10:01:50 +02:00
Max Kellermann 318d0b3976 db/simple/Save: move log call to SimpleDatabase::Load() 2016-10-29 10:00:35 +02:00
Max Kellermann 90a14e14f4 db/simple/Save: migrate from class Error to C++ exceptions 2016-10-29 09:45:34 +02:00
Max Kellermann dea46e8d5a db/Plugin: migrate from class Error to C++ exceptions 2016-10-28 23:15:22 +02:00