Skip to content

Commit f39a18a

Browse files
committed
Fix small oversight in audio buffer
1 parent fc3f3da commit f39a18a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

music_assistant/helpers/audio_buffer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
LOGGER = logging.getLogger(f"{MASS_LOGGER_NAME}.audio_buffer")
2222

23-
DEFAULT_MAX_BUFFER_SIZE_SECONDS: int = 60 * 5 # 5 minutes
23+
DEFAULT_MAX_BUFFER_SIZE_SECONDS: int = 60 * 8 # 8 minutes
2424

2525

2626
class AudioBuffer:
@@ -107,6 +107,9 @@ def is_valid(self, checksum: str, seek_position: int = 0) -> bool:
107107
# Buffer is close to being cleared, don't reuse it
108108
return False
109109

110+
if seek_position > self._discarded_chunks + self.max_size_seconds:
111+
return False
112+
110113
# Check if the seek position has already been discarded
111114
return seek_position >= self._discarded_chunks
112115

0 commit comments

Comments
 (0)