v1.0.4 — fix mid-play swap: don't block Player callback thread

onAVStarted was calling _fetch_sb_segments synchronously, which
subprocess.run()'s our sidecar — up to 8s of blocking on Kodi's
serialized player event thread. When the user started a new video while
one was playing, pv.youtube's stream resolve for the new video raced
with our blocked callback and the new play got dropped as "unplayable
item" before pv.youtube could finish.

Moved the segment fetch + skip loop into a background thread that
starts from onAVStarted and returns instantly. Player callbacks now
clear in microseconds.
This commit is contained in:
Sulkta 2026-05-23 16:31:59 -07:00
parent 45215d4503
commit 566af4a586
3 changed files with 22 additions and 15 deletions

View file

@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/torttube-sidecar"]
[workspace.package]
version = "1.0.3"
version = "1.0.4"
edition = "2021"
license = "GPL-3.0-or-later"
authors = ["Sulkta <oss@sulkta.com>"]