From c0e76181bd01e234457059a3ca2c3eeffc0cd816 Mon Sep 17 00:00:00 2001 From: Bixilon Date: Sun, 25 Jun 2023 01:00:27 +0200 Subject: [PATCH] audio player: don't exceed source limit; increase source limit --- .../de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt | 2 +- .../de/bixilon/minosoft/gui/rendering/sound/SoundConstants.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt index b16cbda54..c17a5b771 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/sound/AudioPlayer.kt @@ -173,7 +173,7 @@ class AudioPlayer( } } // no source available - if (sources.size > SoundConstants.MAX_SOURCES_AMOUNT) { + if (sources.size >= SoundConstants.MAX_SOURCES_AMOUNT) { return null } val source = SoundSource() diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/sound/SoundConstants.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/sound/SoundConstants.kt index 76091a4af..b39cec170 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/sound/SoundConstants.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/sound/SoundConstants.kt @@ -1,6 +1,6 @@ /* * Minosoft - * Copyright (C) 2021 Moritz Zwerger + * Copyright (C) 2020-2023 Moritz Zwerger * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * @@ -17,5 +17,5 @@ object SoundConstants { const val PRELOAD_ALL_SOUNDS = false const val DISABLE_PRELOADING = false - const val MAX_SOURCES_AMOUNT = 32 + const val MAX_SOURCES_AMOUNT = 127 }