Clear voice note media queues within synchronized block.

fork-5.53.8
Alex Hart 2020-11-25 09:25:35 -04:00
rodzic a640d9e298
commit 02931f1826
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -97,9 +97,6 @@ final class VoiceNotePlaybackPreparer implements MediaSessionConnector.PlaybackP
canLoadMore = false;
latestUri = uri;
queueDataAdapter.clear();
dataSource.clear();
SimpleTask.run(EXECUTOR,
() -> {
if (singlePlayback) {
@ -110,7 +107,12 @@ final class VoiceNotePlaybackPreparer implements MediaSessionConnector.PlaybackP
},
descriptions -> {
if (Util.hasItems(descriptions) && Objects.equals(latestUri, uri)) {
applyDescriptionsToQueue(descriptions);
synchronized (queueDataAdapter) {
queueDataAdapter.clear();
dataSource.clear();
applyDescriptionsToQueue(descriptions);
}
int window = Math.max(0, queueDataAdapter.indexOf(uri));