You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
onPause can block the UI thread for seconds (ANR risk), worst in Quad mode #32
Decoder.onPause() stops everything synchronously on the main thread:
RtspClient.stop() calls awaitTermination(2 s), and onPause calls it again for the decoder executor (2 s).
In Quad mode, QuadCell.stop() calls awaitTermination(2 s) for each of the 4 cells.
The worker loops sleep with SystemClock.sleep(), which ignores interrupts. A cell in reconnect back-off (up to 30 s) or in a handshake read (5 s timeout) therefore uses the whole 2 s timeout. With 4 cameras offline, leaving the app can block the UI thread for about 8 s. Android shows an ANR after 5 s of blocked input.
Fix: signal the threads to stop and return immediately; release codecs once the threads have finished. Use interruptible waits (Thread.sleep, or a condition with a timeout) instead of SystemClock.sleep.
Activity
Merge pull request #48 from OpenIPC/fix/decoder-lifecycle
fix: restore camera and Quad mode on resume, no thread leak or long p…
Merge pull request #48 from OpenIPC/fix/decoder-lifecycle