From 08de3489297a48b901fadfec1573388bd801465c Mon Sep 17 00:00:00 2001 From: frranck Date: Wed, 30 Nov 2016 13:42:17 +0100 Subject: [PATCH 1/2] Fix infinite calls to handleFadeTo to avoid infinite calls to handleFadeTo when calling twice fadeOut. --- Source/AudioPlayer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/AudioPlayer.swift b/Source/AudioPlayer.swift index 31fcdf9..043f47a 100644 --- a/Source/AudioPlayer.swift +++ b/Source/AudioPlayer.swift @@ -189,7 +189,7 @@ public class AudioPlayer: NSObject { let volume = startVolume + delta sound?.volume = volume if delta > 0.0 && volume >= targetVolume || - delta < 0.0 && volume <= targetVolume { + delta < 0.0 && volume <= targetVolume || delta == 0.0 { sound?.volume = targetVolume timer?.invalidate() timer = nil From d90519d4a6fbcec28d2cdbaabd74d249275cb344 Mon Sep 17 00:00:00 2001 From: frranck Date: Wed, 30 Nov 2016 16:58:06 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9450645..6818774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ N/A #### Bugfixes -N/A +- Fixed handleFadeTo to avoid an infinite calls situation ## [1.5.0](https://github.com/tbaranes/AudioPlayerSwift/releases/tag/1.5.0) (23-09-2016) @@ -47,4 +47,4 @@ N/A ## [1.2.0](https://github.com/tbaranes/SwiftyUtils/releases/tag/1.2.0) (02-02-2016) -- Add initializer from NSURL - [#1](https://github.com/tbaranes/AudioPlayerSwift/pull/1) \ No newline at end of file +- Add initializer from NSURL - [#1](https://github.com/tbaranes/AudioPlayerSwift/pull/1)