Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

RtspStream.stopRecord() sometimes blocks in Service.onDestroy() since 2.8.1

Aperta
#2,192 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, kotlin

Direzione di ricerca

Start by reading the RtspStream.stopRecord() implementation and the RecordController stop/status-callback path, then check how they interact with Android Service onDestroy(). Try to reproduce the intermittent hang on the reported Android 13 device and compare behavior between library versions 2.6.7 and 2.8.1. Done means stopRecord() returns during service destruction and the STOPPED event is emitted.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
After upgrading the library from version 2.6.7 to 2.8.1, RtspStream.stopRecord() sometimes blocks when it is called from the onDestroy() method of an Android Service.
With library version 2.6.7, the same implementation worked correctly.
When the issue occurs, the call to:
rtspStream.stopRecord()
does not appear to return. The expected RecordController onStatusChange STOPPED event is not received.
The issue is intermittent and does not occur every time the Service is destroyed.

To Reproduce
Steps to reproduce the behavior:

Use com.github.pedroSG94.RootEncoder:library:2.8.1.
Use an Android 13 custom device.
Create and start an RtspStream.
Start recording.
Destroy the Android Service that manages the stream.
Call rtspStream.stopRecord() from the Service onDestroy() method.
In some cases, stopRecord() appears to block.
The expected RecordController onStatusChange STOPPED event is never received.
Code after rtspStream.stopRecord() is not executed.

The same steps work correctly with library version 2.6.7.

Expected behavior
rtspStream.stopRecord() should complete normally when called from the Service onDestroy() method.
The RecordController should emit the STOPPED status event and execution should continue with the code following rtspStream.stopRecord().
This behavior worked correctly with library version 2.6.7.

Library version: 2.8.1
Device: Custom Android device
OS: Android 13
Media server: RTSP
Class used: RtspStream

Additional context
The application uses:

implementation "com.github.pedroSG94.RootEncoder:library:2.8.1"

The problem appears to be a regression between library versions 2.6.7 and 2.8.1, since the same application code and device configuration worked correctly with version 2.6.7.

The relevant code is executed from the onDestroy() method of an Android Service:

override fun onDestroy() {
// ...
rtspStream.stopRecord()
// These instructions are not executed when the issue occurs
// ...
super.onDestroy()
}

When the problem occurs, execution stops at rtspStream.stopRecord(). I do not receive the expected:
RecordController onStatusChange STOPPED callback.

The issue is intermittent: sometimes stopRecord() works correctly, while other times it appears to remain blocked indefinitely.

Lingua principale
Kotlin
Stelle
3k
Fork
946
Merge medio
4g 6h
PR unite (30g)
9

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pedroSG94/RootEncoder

Tutte le issue di pedroSG94/RootEncoder

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.