From 13fd21a9c9a80aab0ea8fae99d54d9a4ee75c188 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Fri, 9 Jul 2021 12:32:27 +0300 Subject: [PATCH] stream-restore: make version check stricter when dropping old entries If we increment ENTRY_VERSION in the future, the old code would drop entries with version 2, but we only want to drop entries with version 1. This issue was spotted by Igor Kovalenko: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/298#note_983365 Part-of: --- src/modules/module-stream-restore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c index ff55871b7..7d1a0f80c 100644 --- a/src/modules/module-stream-restore.c +++ b/src/modules/module-stream-restore.c @@ -1175,7 +1175,7 @@ static struct entry *entry_read(struct userdata *u, const char *name) { pa_datum_free(&data); #ifdef STREAM_RESTORE_CLEAR_OLD_DEVICES - if (version < ENTRY_VERSION && e->device_valid) { + if (version < 2 && e->device_valid) { /* Prior to PulseAudio 14.0, GNOME's sound settings overwrote the * routing for all entries in the stream-restore database when * selecting a device. PulseAudio 14.0 prevents that from happening,