diff --git a/NEWS b/NEWS index 8b5ec0aed..87a1257a0 100644 --- a/NEWS +++ b/NEWS @@ -49,6 +49,12 @@ ver 0.21 (not yet released) * build with Meson instead of autotools * use GTest instead of cppunit +ver 0.20.23 (not yet released) +* protocol + - emit "player" idle event when restarting the current song +* fix broken float to s32 conversion +* new clang crash bug workaround + ver 0.20.22 (2018/10/23) * protocol - add tag fallbacks for AlbumArtistSort, ArtistSort diff --git a/src/input/Error.hxx b/src/input/Error.hxx index 42b88221a..04ea27ab8 100644 --- a/src/input/Error.hxx +++ b/src/input/Error.hxx @@ -30,15 +30,7 @@ * exist? This function attempts to recognize exceptions thrown by * various input plugins. */ -#ifndef __clang__ -/* the "pure" attribute must be disabled because it triggers a clang - bug, wrongfully leading to std::terminate() even though the - function catches all exceptions thrown by std::rethrow_exception(); - this can be reproduced with clang 7 from Android NDK r18b and on - clang 6 on FreeBSD - (https://github.com/MusicPlayerDaemon/MPD/issues/373) */ gcc_pure -#endif bool IsFileNotFound(std::exception_ptr e) noexcept; diff --git a/src/pcm/FloatConvert.hxx b/src/pcm/FloatConvert.hxx index 8022fd378..70b00bcba 100644 --- a/src/pcm/FloatConvert.hxx +++ b/src/pcm/FloatConvert.hxx @@ -34,7 +34,8 @@ struct FloatToIntegerSampleConvert { typedef typename SrcTraits::long_type SL; typedef typename DstTraits::value_type DV; - static constexpr SV factor = 1 << (DstTraits::BITS - 1); + static constexpr SV factor = uintmax_t(1) << (DstTraits::BITS - 1); + static_assert(factor > 0, "Wrong factor"); gcc_const static DV Convert(SV src) noexcept { @@ -53,7 +54,8 @@ struct IntegerToFloatSampleConvert { typedef typename SrcTraits::value_type SV; typedef typename DstTraits::value_type DV; - static constexpr DV factor = 0.5 / (1 << (SrcTraits::BITS - 2)); + static constexpr DV factor = 1.0 / FloatToIntegerSampleConvert::factor; + static_assert(factor > 0, "Wrong factor"); gcc_const static DV Convert(SV src) noexcept { diff --git a/src/player/Control.cxx b/src/player/Control.cxx index b53984c53..67eaec7a1 100644 --- a/src/player/Control.cxx +++ b/src/player/Control.cxx @@ -291,12 +291,8 @@ PlayerControl::LockSeek(std::unique_ptr song, SongTime t) assert(song != nullptr); - { - const std::lock_guard protect(mutex); - SeekLocked(std::move(song), t); - } - - idle_add(IDLE_PLAYER); + const std::lock_guard protect(mutex); + SeekLocked(std::move(song), t); } void diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx index cd930c039..5e2f7f853 100644 --- a/src/player/Thread.cxx +++ b/src/player/Thread.cxx @@ -606,6 +606,8 @@ Player::SeekDecoder() noexcept pc.outputs.Cancel(); } + idle_add(IDLE_PLAYER); + if (!dc.IsSeekableCurrentSong(*pc.next_song)) { /* the decoder is already decoding the "next" song - stop it and start the previous song again */