Commit Graph

1810 Commits

Author SHA1 Message Date
Max Kellermann cb4fdac469 playlist/cue/parser: fix nullptr dereference
Closes https://github.com/MusicPlayerDaemon/MPD/issues/974
2020-10-05 20:26:42 +02:00
Max Kellermann ac46a84391 playlist/cue/parser: fix off-by-one buffer overflow
cue_next_word() can return a pointer one past the end of the string if
the word is followed by the terminating null byte.
2020-10-05 20:26:02 +02:00
Max Kellermann 4484d7a5c2 output/jack: implement Interrupt() 2020-10-02 11:00:04 +02:00
Max Kellermann b80a135cf3 output/pulse: implement Interrupt() 2020-10-02 10:52:25 +02:00
Max Kellermann 4ad525d939 output/alsa: implement Interrupt()
This allows canceling the blocking method LockWaitWriteAvailable(),
and thus allows breaking free of misbehaving ALSA drivers, avoiding a
MPD lockup.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/966
2020-10-02 10:35:18 +02:00
Max Kellermann 65d257675f increment version number to 0.22.1 2020-09-23 16:15:44 +02:00
Max Kellermann 56fa7368e8 release v0.22 2020-09-23 15:26:51 +02:00
Max Kellermann 416d4e4433 NEWS: update recommended compilers 2020-09-23 15:12:17 +02:00
Max Kellermann bc47a16943 release v0.21.26
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl9op0MQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEvtmD/46dhcOHUXBreLkKmfy1d8YYrSUBfaNGNIa
 m32Lhh2Di27yd5uclQiOVnBghbPEdPobNB6dpZzM7VFkl0LXovbi2bOP0/IkfV0L
 0Aa8yacUjHo9zoSjGWnw0uJxLkMjwp7ybV/RI0yI9Z203zUdQX5BqAwc0GlDAhrq
 ZheuvHbZqr6PIdy+yFMvS7zhkeO7kMRxlT8xy7/6LskkSmc5wJ90X2vS1sD/6T+9
 NfAQkEE7PgKHir6xjZfPTi5PzIO+tK9/RVw705LDubsjFjEPBLWyvG4uD97dazbu
 EQZzj5E82wxwvZvx+/xuyyykkhaoBqtegD2DrkafFm20sIzsc9qLC24GXzWd4Oq0
 u7RQoO8hn6WI3mMUW/nJNSZk/c9xgeKcFBtgZiNFaDrnwKeWHNtafwqJlU0lanXH
 tpjRP0kWphAcTfa1JBcCN0SpqjlB+s18xM102hnIWxWlfSmlEyb9yLk+jbFDQcpP
 6i/UmWIDEBlNf68beg89wD4p/FJePgEuwBGrIMHxA41hqjmFCwuklcvhdbu0zBFy
 frr9kWMSp6Xun1lwW0jWdfbEBWujNGMEHx//SDoIKD22gpdtnajLhNqjiZuu1LN7
 RE7fF1v5c7cSGNVMLEam4bUXntzxTXhCCFbYUdh29TWqEr+pM+a429/jZMgYcGtz
 jVp2qqxc5w==
 =mDD4
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.26' into master

release v0.21.26
2020-09-21 15:20:02 +02:00
Max Kellermann 566787f041 release v0.21.26 2020-09-21 15:14:43 +02:00
Max Kellermann 5130acf3ea decoder/ffmpeg: implement protocols() and uri_decode() (for RTSP)
This implements the feature that was missing/broken in this bug
report: https://github.com/MusicPlayerDaemon/MPD/issues/930
2020-09-21 14:57:12 +02:00
Max Kellermann 7c8427b0f7 Merge branch 'v0.21.x' into master 2020-09-21 11:37:50 +02:00
Desuwa 23d5a2b862 Support opus header gain tags and match opus playback volume to other tracks when ReplayGain is enabled. 2020-09-21 10:51:06 +02:00
Max Kellermann 0acc398c52 Merge branch 'v0.21.x' into master 2020-09-17 14:44:20 +02:00
Max Kellermann e113ce9621 db/update/InotifyUpdate: obey `.mpdignore` files
Closes https://github.com/MusicPlayerDaemon/MPD/issues/846
2020-09-17 14:17:17 +02:00
Max Kellermann 32f4f15831 player/Thread: call OnPlayerSync() in SeekDecoder()
This fixes a spurious "single" mode bug which occurs when using "play"
or "seek" to start playback on the song that is currently paused: in
that case, the main thread never queues the next song, and at the end
of the song, the player thread exits Run(), stopping playback, and
after that, the main thread starts the next song without considering
"single" mode.

By calling OnPlayerSync(), we ensure that the main thread gets a
chance to queue the next song before the player thread exits the Run()
loop.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/850
2020-09-16 20:36:19 +02:00
Max Kellermann c61a3b8d13 LogBackend: change the initial log_threshold to DEFAULT
The log levels have always been very confusing (and badly named), but
this was most confusing: if there's a log level called "default", why
is it not the default?

Closes https://github.com/MusicPlayerDaemon/MPD/issues/926
2020-09-16 17:17:34 +02:00
Max Kellermann e10b867fe6 decoder/ffmpeg: add "hls+http://" to the list of supported protocols 2020-09-16 16:36:07 +02:00
Max Kellermann 43e230f543 decoder/ffmpeg: remove "rtsp://" from the list of supported protocols
FFmpeg implements RTSP as a demuxer, not as a protocol handler.  Thus,
avio_open() cannot be used, and our input plugin cannot handle RTSP.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/930
2020-09-16 16:32:31 +02:00
Max Kellermann e8380cf2aa Merge branch 'v0.21.x' into master 2020-09-07 21:15:53 +02:00
Max Kellermann b2ae5298a7 archive/iso9660: implement seeking 2020-09-07 21:13:28 +02:00
Max Kellermann 17dd21ac7f archive/iso9660: fix unaligned reads
Oh the horror!  This plugin cannot possibly ever have worked.  It was
broken from the start, when it was added in commit 37796699cf nearly
twelve (!) years ago.

The plugin would always read at sector boundaries, so it could only
ever work at multiples of 2 kB.
2020-09-07 21:08:46 +02:00
Max Kellermann 67c7116f05 Merge branch 'v0.21.x' into master 2020-09-04 18:35:21 +02:00
Max Kellermann 9e6c4f8d80 archive/bzip2: throw on unexpected input EOF
Don't silently return 0 when there is no more data, because this may
crash the caller.  And flush output even if input EOF has been reached.
2020-09-04 17:54:53 +02:00
Max Kellermann 1f6a7d6462 archive/zzip: fix crash on corrupt ZIP file
Sometimes, zzip_file_read() returns 0 even though the end of the file
was not reached.  This causes assertion failures in
DecoderBridge::Read().

Closes https://github.com/MusicPlayerDaemon/MPD/issues/935
2020-09-04 14:34:54 +02:00
Max Kellermann 0aa0ffb67b decoder/sndfile: allow partial reads at end of file
While libsndfile doesn't like partial reads in the middle of a file
(see commit 95ac6071b9), it allows partial reads at the end of a file.
It doesn't pay attention to the file size when issuing a read.

Commit ecb67a1ed1 (MPD 0.18.12) was a regression: previously,
partial reads at the end of a file were possible, but switching to
decoder_read_full() made this an error condition.  This way, a portion
at the end of each file was lost, leading to corruption with gapless
playback (https://github.com/MusicPlayerDaemon/MPD/issues/936).

This fix switches to the newly introduced function
decoder_read_much(), which does the same as the code before commit
ecb67a1ed1.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/936
2020-09-04 13:35:00 +02:00
Max Kellermann 4f6c54ecb3 output/osx: catch kAudioDevicePropertyHogMode errors
Our AudioObjectGetPropertyDataT() wrapper throws exception on error,
and calling it from OSXOutput::Disable() can cause MPD crash due to
std::terminate().

Closes https://github.com/MusicPlayerDaemon/MPD/issues/932
2020-08-14 16:33:43 +02:00
Max Kellermann f6dc9bcad6 */smbclient: use the new API with SMBCCTX parameter
As a side effect, the input plugin closes the SMB/CIFS connection
after closing the file.

This solves one part of
https://github.com/MusicPlayerDaemon/MPD/issues/916
2020-07-20 22:05:05 +02:00
Max Kellermann 448b397cb8 output/sles: support floating point samples
According to https://developer.android.com/ndk/guides/audio/opensl/android-extensions

This feature was mentioned in https://github.com/MusicPlayerDaemon/MPD/issues/922
2020-07-20 15:23:50 +02:00
Max Kellermann 9bda0379af increment version number to 0.21.26 2020-07-16 12:53:22 +02:00
Max Kellermann b74a91427d release v0.21.25
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl8DfoEQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEgVqD/0X+QAV77Pw+RDP7qPtyYDfBH6jOvSpAmHm
 moXIFMBaPeIrAFd6jfYTL+JMcVf+jfS6H86JlrWVz5/jerV0St/LxwrTGRqkac8K
 OFDmMl2SE2KkniLOTHC2nKq3RFzAKDKK8uCaw3JFpXiAezuRXutX19nHitbau+HC
 jD+2Ybyy149fPAB+D6aON6vjZI9hQyyeGoEbducZ5uZz+tvzwY0w1KcnDlaicjJq
 Wdu16RFFZNXJnrXQ8hPWTxltgIdRfc9xMrIkydsyQkpW5jLZAJn9Yvl4xIQJhJlb
 HlF2/xAUAIqykDqjbxWGnQYywOtCh12XDdn2S2AzAGgNH0z++EBiMyQjLorHf3Eo
 wSa/qvi1E5rf8WBCaz3Qa/oa9trj4TQcQFQ+v9esO/yBn3O0K6oGr67P45f1KRqg
 SAwnwd+YwYp838lT+MlueD+c67QAY64qCYjI810o3rZ3cyEitWKF6kkvwfzqCfly
 HeZJS7OsG1UoxInSfnYwJW1svwtkfZU0WqWHxqKSL/MnwihXhlkhkom8jIS+yYcO
 pVPllLvF1H0d/Y2Eb2MH6OKZF+7c5cwSeXJzA808NwzE5dpL2tHAgjxhS/P66voF
 /UqLyXySqEaUijp9hW3jEeFJ5TSP2bCaNXnbsQUoM4uqjhkoUi9QLTJIqyG1PKmM
 3JKzuZXy2g==
 =eK6Y
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.25'

release v0.21.25
2020-07-06 21:47:30 +02:00
Max Kellermann c67372f8af release v0.21.25 2020-07-06 21:41:53 +02:00
Max Kellermann 00789de7d4 db/upnp/Object: root nodes are allowed to omit parent_id and name
This fixes compatibility with Plex DLNA.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/851
2020-07-06 21:36:30 +02:00
Max Kellermann c3cfb5fe16 Merge branch 'v0.21.x' 2020-07-06 20:56:52 +02:00
Max Kellermann fe48e5596f command/storage: automatically scan new mounts
Closes https://github.com/MusicPlayerDaemon/MPD/issues/841
2020-07-06 20:23:41 +02:00
Max Kellermann 33ee35ab92 command/storage: check if mount point is busy
When mounting something over a directory that is already a mount
point, CompositeStorage::Mount() silently overwrites the previously
mounted storage, disposing it.  After that, SimpleDatabase::Mount()
will fail and handle_mount() will roll back the
CompositeStorage::Mount() command, effectively unmounting what was
there before (and also leaking memory).

Closes https://github.com/MusicPlayerDaemon/MPD/issues/918
2020-07-06 17:49:38 +02:00
Max Kellermann 5b291ff768 db/update/Walk: pass concatenated .mpdignore URI to storage.MapUTF8()
Fixes the "Unrecognized URI" error with the udisks storage plugin,
which is caused by the kludge in UdisksStorage::MapUTF8().
2020-07-06 17:19:38 +02:00
Max Kellermann 6517b2d2ac neighbor/upnp: remove D-Bus filter and match in Close()
Fixes use-after-free crash bug during MPD shutdown.
2020-07-06 16:15:18 +02:00
Max Kellermann bfdf13dca3 decoder/Plugin: allow scan_{file,stream}() to throw
Bug #915 is about an I/O exception thrown where none was allowed,
leading to crash via std::terminate().  However, instead of catching
and logging the error inside the decoder plugin, it should be able to
propagate the I/O error to the MPD core, so MPD can avoid trying other
decoder plugins.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/915
2020-07-06 14:13:34 +02:00
Max Kellermann 86823af685 Merge branch 'v0.21.x' 2020-07-02 15:34:16 +02:00
Max Kellermann 8047102542 output/osx: don't restart AudioUnit at the end of Cancel()
We shouldn't restart the AudioUnit while the ring buffer is empty, or
else our render callback may emit noise.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/771
2020-07-02 15:20:43 +02:00
Max Kellermann a08d4b3d66 Merge branch 'v0.21.x' 2020-07-01 22:09:33 +02:00
Max Kellermann faee5bbb78 decoder/opus: implement End Trimming (RFC7845 4.4)
Closes https://github.com/MusicPlayerDaemon/MPD/issues/867
2020-07-01 21:26:34 +02:00
Max Kellermann 46eab05045 decoder/opus: allocate buffer only in the first chained song
Fixes memory leak.  That's what we get for
2020-07-01 21:07:49 +02:00
Max Kellermann 760238fe16 decoder/opus: apply pre-skip (RFC7845 4.2)
Fixes the first part of
https://github.com/MusicPlayerDaemon/MPD/issues/867
2020-07-01 20:44:53 +02:00
Max Kellermann 691b6a236e output/osx: improve sample rate selection
The formula in osx_output_score_sample_rate() to detect multiples of
the source sample rate was broken: when given a 44.1 kHz input file,
it preferred 16 kHz over 48 kHz, because its `frac_portion(16)=0.75`
is smaller than `frac_portion(48)=0.91`.

That formula, introduced by commit 40a1ebee29, looks completely
wrong.  It doesn't do what the code comment pretends it does.

Instead of using that `frac_portion` to calculate a score, this patch
adds to the score only if `frac_portion` is nearly `0` or `1`.  This
means that the factor is nearly integer.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/904
2020-07-01 17:38:08 +02:00
Max Kellermann 3d7147390f Merge branch 'v0.21.x' 2020-07-01 16:56:17 +02:00
Max Kellermann ca705e1e37 python/build/meson.py: set BOOST_ROOT for Meson 0.54
Commit
08224dafcb
changed Meson to require BOOST_ROOT for cross builds.
2020-07-01 16:55:28 +02:00
Max Kellermann d9f9b3df10 input/file: detect premature end of file
A bug report (https://github.com/MusicPlayerDaemon/MPD/issues/912)
suggests that on Linux, reading on `cifs` files may rarely return 0 (=
end of file) before the end of the file has really been reached.  But
that's just a theory which I need to validate, so this runtime check
shall catch this condition before the assertion in
DecoderBridge::Read() crashes MPD.  Let's see.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/912
2020-07-01 15:14:27 +02:00
Max Kellermann a43ee97746 util/UriUtil: strip credentials from smb:// URIs
Closes https://github.com/MusicPlayerDaemon/MPD/issues/910
2020-06-22 22:48:56 +02:00