mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-12-03 20:01:50 +01:00
Every JNI call went through one ReentrantLock that guards the Player against destruction. The poller held it through nativeState, nativeTracks and nativeChapters, synchronous property reads that wait on mpv's core lock while the demuxer fetches a block. A pause, a seek or a volume step from the UI then waited behind that fetch. Those three reads change nothing, so they now take only the shared side of a read-write lock that destruction takes exclusively, after setting `closed`. A reader either sees `closed` or keeps the Player alive until it returns. Everything else keeps the exclusive lock.