Compare commits

...

2 Commits

Author SHA1 Message Date
Florian Renaud
87e661e3b5 Add changelog file 2023-01-05 14:36:22 +01:00
Florian Renaud
682bb8bde0 VB - Stop listening if we reach the last received chunk and there is no last sequence number 2023-01-05 10:52:22 +01:00
2 changed files with 4 additions and 1 deletions

1
changelog.d/7899.bugfix Normal file
View File

@ -0,0 +1 @@
[Voice Broadcast] Stop listening if we reach the last received chunk and there is no last sequence number

View File

@ -419,7 +419,9 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
// Next media player is already attached to this player and will start playing automatically
if (nextMediaPlayer != null) return
val hasEnded = !isLiveListening && mostRecentVoiceBroadcastEvent?.content?.lastChunkSequence == playlist.currentSequence
val currentSequence = playlist.currentSequence ?: 0
val lastChunkSequence = mostRecentVoiceBroadcastEvent?.content?.lastChunkSequence ?: 0
val hasEnded = !isLiveListening && currentSequence >= lastChunkSequence
if (hasEnded) {
// We'll not receive new chunks anymore so we can stop the live listening
stop()