Commit Graph

1325 Commits

Author SHA1 Message Date
Max Kellermann 44b200240f player/Thread: never reuse decoder when switching radio streams
When switching to another song manually, the player checks if the
decoder is already decoding that song; if so, it will attempt to reuse
it by seeking it to the new position.  That however fails if the
decoder is not seekable (e.g. a radio stream) which leaves the user
unable to switch to that song with the bogus error message "Not
seekable".
2018-04-25 21:19:26 +02:00
Max Kellermann 73013a3c04 input/thread: move code to Stop()
Fixes crash due to "pure virtual method called" in the "mms" input
plugin.  Closes #253
2018-03-15 19:29:55 +01:00
Max Kellermann c2c2c29658 input/thread: set InputStream::ready after Open() failure
Without setting the "ready" flag, the caller will wait in WaitReady()
forever, locking up MPD.  Closes #252
2018-03-14 13:15:03 +01:00
Max Kellermann dadd3ca671 protocol/ArgParser: disallow negative seek times
Instead of stopping playback (due to seek time overflow), reject the
seek command.  Closes #240

Relative negative values (with "seekcur") are still allowed, and MPD
will fix the resulting position if it turns out to be negative.  But
the "seek" and "seekid" commands use an unsigned time stamp which must
not be negative.
2018-03-04 11:46:11 +01:00
Christian Kröner 79535212c8 Get rid of GCD on macOS which breaks debug builds
With Grand Central Dispatch used in Main.cxx, debug builds on macOS
crash as the IsInside() assertion gets triggered in the event loop. As
a simple fix, usage of GCD is removed. Plugging and unplugging
headphones or changes of the default output device was tested without
issues. Whatever the original commit tried to fix by GCD probably does
not need fixing anymore.
2018-03-04 10:43:55 +01:00
Max Kellermann ef5f96a193 increment version number to 0.20.19 2018-03-04 10:42:05 +01:00
Max Kellermann 0ebeaa9ac2 release v0.20.18 2018-02-24 22:55:06 +01:00
Max Kellermann 25cd47b8dc win32/build.py: enable libnfs
Now that all build failures have been fixed, we can enable the
feature.
2018-02-24 22:44:42 +01:00
tpoeiras 3f3e0739c4 Fix curl storage plugin failure if the authentication method is different than basic. 2018-02-24 21:59:13 +01:00
Max Kellermann c5c1c64a81 python/build/libs.py: add libnfs
Enable the NFS storage plugin on Android.

Closes #226
2018-02-20 22:47:17 +01:00
Max Kellermann 026aef7465 decoder/flac: move the SubmitData() call out of the callback
This addresses two problems:

1. the libFLAC write callback had to send an error status to its
caller when SubmitData() returned a command; this disrupted libFLAC
and the resulting command could not be used for anything;

2. the libFLAC function FLAC__stream_decoder_seek_absolute() also
calls the write callback, but its result cannot be used, because
seeking is still in progress, so we lose all data from one FLAC frame.
By moving the SubmitData() call until after CommandFinished(), we
avoid losing this data.  This fixes another part of #113
2018-02-17 13:33:53 +01:00
Max Kellermann 986ec877b0 decoder/Bridge: truncate last chunk at the exact end_time
Instead of passing whole chunks to the MusicPipe and checking the
end_time after each chunk, truncate the last chunk if it would exceed
the end_time.  This requires keeping track of the absolute PCM frame
number.

This fixes a problem with gapless CUE song transitions: a small part
of the following song was always played twice.

Closes #113
2018-02-17 13:10:00 +01:00
Max Kellermann 79981f3cda increment version number to 0.20.18 2018-02-17 01:21:46 +01:00
Max Kellermann c2940a8385 release v0.20.17 2018-02-11 13:02:53 +01:00
Max Kellermann bede564618 mixer/alsa: work around rounding error at volume 0
Due to rounding errors, a slightly negative value can be passed to
set_normalized_volume(), which will make the log10() call fail.
Actually, volume 0 is already failing because log10(0) is illegal.  So
let's fix this by implementing two corner cases: <=0 and >=100.

Closes #212
2018-02-10 09:07:51 +01:00
Max Kellermann e0ca4b865a android: require SDK version 14
Closes #213.
2018-02-10 00:03:23 +01:00
Max Kellermann 6de92bb42b pcm/Order: fix size calculation with 8 channels
This was a buffer overflow bug which could cause MPD crahes when
playing back 8 channels with the ALSA output plugin.

Closes #216
2018-02-09 19:01:12 +01:00
Max Kellermann 817656504d thread/Util: implement system call wrapper for sched_setscheduler()
There is a POSIX definition for sched_setscheduler(), but Linux does
not implement that; instead of changing the process's scheduler, it
only affects one thread.  This has caused some confusion among
application developers and C library developers.

While glibc implements Linux semantics, Musl has made their
sched_setscheduler() function an always-failing no-op, causing the
error message "sched_setscheduler failed: Function not implemented".

 http://git.musl-libc.org/cgit/musl/commit/src/sched/sched_setscheduler.c?id=1e21e78bf7a5c24c217446d8760be7b7188711c2

Instead of relying on the C library which may be unreliable here, we
now roll our own system call wrapper.

Closes #218
2018-02-09 18:43:45 +01:00
Max Kellermann 5acb978f8f increment version number to 0.20.17 2018-02-09 18:43:45 +01:00
Max Kellermann 975a4ae871 release v0.20.16 2018-02-03 19:55:07 +01:00
Max Kellermann 12fd1cad0c archive/iso9660: libcdio 2.0 compatibility
Closes #173
2018-02-03 19:32:31 +01:00
Max Kellermann dead461542 lib/upnp/Init: enable IPv6 2018-01-31 18:15:46 +01:00
Max Kellermann ec408ca6a6 output/pulse: fix crash during auto-detection
The PulseOutput needs to be "enabled" before WaitConnection() may be
called.

Closes #207
2018-01-30 10:06:36 +01:00
Max Kellermann 8376578921 db/simple/Mount: drop mount point prefix from LOCATE_TAG_BASE_TYPE
Fixes search within mount points, resulting in error "No such
directory".

Closes #190
2018-01-19 23:52:57 +01:00
Max Kellermann 2eef4e6716 thread/Thread: add debug attribute "inside_handle"
This attribute shall be used only for IsInside() to make this safe
against a race condition described in #188:

> There is no requirement on the implementation that the ID of the
> created thread be available before the newly created thread starts
> executing.

http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_create.html):

This means that on some pthread implementations (e.g. Haiku), the
assert(thread.IsInside()) could fail.

Closes #188
2018-01-08 09:58:18 +01:00
Max Kellermann 0ef553d30e increment version number to 0.20.16 2018-01-06 13:15:47 +01:00
Max Kellermann ed4d0aa909 release v0.20.15 2018-01-05 17:55:25 +01:00
Max Kellermann cab77e35e0 queue/PlaylistControl: fix crash after seek failure
This completes the bug fix commit
2065e3290452377b2931f3129b230c8cc536cbc8; if we clear "queued" then we
must clear "queued_song" as well, or another variant of the assertion
fails.
2018-01-05 13:00:24 +01:00
Max Kellermann 329f9cd9fe thread/Util: no ioprio_set() on Android due to seccomp/SIGSYS 2018-01-04 19:33:14 +01:00
Felix Hädicke fbdb8b406e Makefile.am: build Android APK package without Ant
In current Android SDK releases, Ant support was removed. Move the
necessary build steps from the former Ant build system to our Makefile,
and call the required build tools from the Android SDK (aapt and dx),
Java SDK (javac) and Info-ZIP (zip) directly.

[mk: copied from Felix's commit
e52b906dba971a1173f9e8f83d32b52ee9f89af3 in the XCSoar project)
2018-01-04 18:55:54 +01:00
Max Kellermann c68ed40661 pcm/SoxrResampler: implement method Reset() 2018-01-02 21:53:09 +01:00
Max Kellermann ff624075a8 storage/State: check if a CompositeStorage exists; fixes nullptr dereference
Fixes another crash bug caused by commit
64d141f71e
2018-01-02 14:13:26 +01:00
Max Kellermann ff6b263b48 increment version number to 0.20.15 2018-01-02 13:46:03 +01:00
Max Kellermann c0bf052fa9 release v0.20.14 2018-01-01 17:55:38 +01:00
Max Kellermann d094c168aa archive/{iso9660,zzip}: unlock the mutex during I/O
Similar to commit 31ab78ae8e
2017-12-22 16:09:03 +01:00
Max Kellermann 4b18460bc6 archive/bz2: unlock the archive mutex and lock the file mutex
Fixes deadlock because FileInputStream::Read() unlocks the mutex
(which was not locked) and then locks it, keeping it locked.  This can
result in a deadlock.  This happens because the archive and the file
mutex are different.
2017-12-22 16:02:23 +01:00
Ilya ilyxa Tyshchenko 2becf79223 correct action for compile on Solaris 11.3 X86 2017-12-21 18:42:36 +01:00
Max Kellermann c88056ba83 db/simple: fix file corruption in the presence of mount points
If a directory is a mount point, omit the "directory: " as well.

This bug is years old, but has become more visible now that mount
points are persistent in the state file.
2017-12-21 10:16:52 +01:00
Max Kellermann e769751221 increment version number to 0.20.14 2017-12-21 10:15:16 +01:00
Max Kellermann 49b9a90c3f release v0.20.13 2017-12-18 23:41:56 +01:00
FlashSystems 64d141f71e Save and restore mountpoints within the state file.
Signed-off-by: FlashSystems <developer@flashsystems.de>
2017-12-18 23:39:01 +01:00
FlashSystems c488d3123f Fix `lsinfo` and `add` for mounted databases.
If `SimpleDatabase::Visit` is called on a database that contains a mounted directry the URIs of the elements passed to the callbacks are not prefixed by the mountpoint path. This leads to lsinfo and add not working because they use the wrong URI. This pull request is using the `WalkMount` helper function to create prefixed versions of `VisitDirectory`, `VisitSong` and `VisitPlaylist` to add the correct prefix to the parameters of the callback functions.
2017-12-18 23:33:08 +01:00
Stefano Miccoli 967af60327 rounds alsa HW mixer volume towards ±∞ depending on sgn(∆ vol)
This alleviates a problem in which 'volume +1' cannot be undo by
'volume -1' when using alsa hw mixer.

Closes #104
2017-12-18 21:29:03 +01:00
Yue Wang f1ef9f9d31 OSXOutputPlugin: set the buffer time to be 100ms
[mk: the following text was copied from
https://github.com/MusicPlayerDaemon/MPD/pull/167]

For certain format (hi-res files) and normal buffer size hardware, The
hardware may at once consume most of the buffers. However, in Delay()
function, MPD is supposed to wait for 25 ms after the next try. it
will create a hiccup. The negative impact is much major than
increasing the latency.

I understand larger buffers come at a price. That's why in my earlier
commit last year I significantly reduced it. However, the buffer size
in CoreAudio is set according to the hardware, which is super small
latency. For instance, the system audio of 2015 generation of macbook
pro has maximum buffer size of 4096 samples, which is just 0.09s for
44.1k framerate, or 0.04s for 96k frames --- . compare to the 0.5 sec
latency alsa plugin has, even if we quadruple it, it's still super
tiny.
2017-12-12 10:56:42 +01:00
Max Kellermann dfaf08743c *: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.

Closes #169
2017-12-12 10:22:20 +01:00
Max Kellermann 75d068b7cd Makefile.am: include Windows cross-build script in source tarball 2017-12-05 11:24:52 +01:00
FlashSystems 1208503888 Removing gcc_malloc attribute from `Directory::CreateChild` to fix
assignment of `mnt->mounted_database` in `SimpleDatabase::Mount`.
2017-12-03 12:34:08 +01:00
Max Kellermann 478180ebe4 queue/PlaylistEdit: shuffle appended songs only within its priority group
Fixes #165.
2017-12-02 17:17:02 +01:00
Max Kellermann 78728138a0 lib/upnp/Compat: disable the 1.8 API emulation with libupnp 1.6.24
libupnp 1.6.24 added a few badly designed macros which break the MPD
build:

 8177a4195a/

To work around this, we disable our emulation functions (from
714011c81e) on this libupnp version.

Closes #163
2017-12-02 14:47:27 +01:00
FlashSystems 63fc98591d Fix for "Mount-Points are purged from database on update/rescan."
Signed-off-by: FlashSystems <developer@flashsystems.de>
2017-11-27 22:34:49 +01:00