Commit f7997d2
fix(inputs/musicassistant): stop zone playback when MA ends the stream
MA has no player pause command, so it pauses and stops by ending the
stream. handleJsonMessage() reset only its local stream state and
returned, so the wired stop handler never ran and handleInputStreamStop()
was dead code: the input stream got cleared but the zone kept playing.
Dispatch onStream.stop() on stream/end and debounce the stop by 1s, since
a track change ends the stream too but a fresh stream/start follows within
milliseconds. The guards on playingState and recentPlayIntent had to go:
MA never reports a paused state on this path, so playingState stays true
and swallows every stop, and a pause pressed ~6s after play hit the
recentPlayIntent boundary exactly.
Not on stream/clear: that discards buffered audio for a seek or a stream
replacement while playback continues, so stopping there would tear down
the zone mid-seek whenever the new audio outlasts the debounce.
Closes #307
Co-Authored-By: Rudy Berends <rudy.berends@visolity.nl>1 parent 787ebfb commit f7997d2
2 files changed
Lines changed: 62 additions & 15 deletions
Lines changed: 44 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| 115 | + | |
| 116 | + | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| |||
1280 | 1288 | | |
1281 | 1289 | | |
1282 | 1290 | | |
| 1291 | + | |
| 1292 | + | |
1283 | 1293 | | |
1284 | 1294 | | |
1285 | 1295 | | |
| |||
1329 | 1339 | | |
1330 | 1340 | | |
1331 | 1341 | | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1332 | 1352 | | |
1333 | 1353 | | |
1334 | 1354 | | |
1335 | 1355 | | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | | - | |
1347 | | - | |
1348 | | - | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
1349 | 1380 | | |
1350 | | - | |
1351 | | - | |
1352 | 1381 | | |
1353 | 1382 | | |
1354 | 1383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
358 | 376 | | |
359 | 377 | | |
360 | 378 | | |
| |||
0 commit comments