Commit 4c22705
committed
fix(queue): a stopped output no longer winds the queue back (#360)
Found while measuring the Soloist track boundary: 26 ms after the queue
correctly moved to the next track, its index went back to the one that had
just finished. The room played track two while the queue said track one — so
`next` played the track that was already sounding, a second time, and the
queue highlighted the wrong line. That is the "played twice" and the "queue
gets out of sync" half of the report, and it has nothing to do with Spotify.
The trace named it: the engine session of the finished track is torn down
*after* the new one has started, and on its way out it reports itself stopped
with its own uri. `updateOutputState` reconciles the queue index to whatever
uri an output names, so it dutifully wound the index back onto the track the
room had already left.
That reconcile exists to follow an output that is playing something of its own
choosing — Squeezelite or Cast on a track the zone did not start. An output
that has stopped is not on any entry and cannot say where the queue is, so a
`stopped` report no longer moves it. The end-of-track forcing just above still
reads that same report; only the index is left alone.
The regression test fails without the change.1 parent 38e1781 commit 4c22705
2 files changed
Lines changed: 28 additions & 1 deletion
File tree
- src/application/zones/playback
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
974 | 995 | | |
975 | 996 | | |
976 | 997 | | |
| |||
0 commit comments