From 682bb8bde09fb8f083a7442091b91a0214fe2cf9 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Wed, 4 Jan 2023 14:06:58 +0100 Subject: [PATCH 1/2] VB - Stop listening if we reach the last received chunk and there is no last sequence number --- .../voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt b/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt index d56f4ad715..9cb894bb58 100644 --- a/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt +++ b/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt @@ -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() From 87e661e3b5d895990648f5cc0e71e60d08d10982 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Thu, 5 Jan 2023 14:36:22 +0100 Subject: [PATCH 2/2] Add changelog file --- changelog.d/7899.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/7899.bugfix diff --git a/changelog.d/7899.bugfix b/changelog.d/7899.bugfix new file mode 100644 index 0000000000..d95af29d8d --- /dev/null +++ b/changelog.d/7899.bugfix @@ -0,0 +1 @@ +[Voice Broadcast] Stop listening if we reach the last received chunk and there is no last sequence number