Fix small oversight in audio buffer
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 25 Oct 2025 19:35:50 +0000 (21:35 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 25 Oct 2025 19:35:50 +0000 (21:35 +0200)
music_assistant/helpers/audio_buffer.py

index 735a828be2b88919f599aad8367db0a1c2099e0f..7f7403b5593ff041e9934af32e014438510545dc 100644 (file)
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
 
 LOGGER = logging.getLogger(f"{MASS_LOGGER_NAME}.audio_buffer")
 
-DEFAULT_MAX_BUFFER_SIZE_SECONDS: int = 60 * 5  # 5 minutes
+DEFAULT_MAX_BUFFER_SIZE_SECONDS: int = 60 * 8  # 8 minutes
 
 
 class AudioBuffer:
@@ -107,6 +107,9 @@ class AudioBuffer:
             # Buffer is close to being cleared, don't reuse it
             return False
 
+        if seek_position > self._discarded_chunks + self.max_size_seconds:
+            return False
+
         # Check if the seek position has already been discarded
         return seek_position >= self._discarded_chunks