使用 exoplayer 播放 RTSP 流时,发生 IllegalStateException 异常

When playing an RTSP stream with exoplayer, an IllegalStateException exception occurs

提问人:kaitian 提问时间:9/17/2023 最后编辑:kaitian 更新时间:9/17/2023 访问量:72

问:

使用 exoplayer 播放 RTSP 流,然后断开网络或中断 RTSP 流时,会随机报 checkStateNotNull 异常;版本: media3-exoplayer:1.1.1;具体如下:

E/AndroidRuntime: FATAL EXCEPTION: ExoPlayer:Playback
Process: com.join.driving, PID: 28548
java.lang.IllegalStateException
    at androidx.media3.common.util.Assertions.checkStateNotNull(Assertions.java:117)
    at androidx.media3.exoplayer.rtsp.RtspMessageChannel.send(RtspMessageChannel.java:190)
    at androidx.media3.exoplayer.rtsp.RtspClient$MessageSender.sendRequest(RtspClient.java:481)
    at androidx.media3.exoplayer.rtsp.RtspClient$MessageSender.sendSetupRequest(RtspClient.java:380)
    at androidx.media3.exoplayer.rtsp.RtspClient.continueSetupRtspTrack(RtspClient.java:296)
    at androidx.media3.exoplayer.rtsp.RtspClient.setupSelectedTracks(RtspClient.java:221)
    at androidx.media3.exoplayer.rtsp.RtspMediaPeriod.maybeSetupTracks(RtspMediaPeriod.java:478)
    at androidx.media3.exoplayer.rtsp.RtspMediaPeriod.access$2600(RtspMediaPeriod.java:66)
    at androidx.media3.exoplayer.rtsp.RtspMediaPeriod$RtpLoadInfo.lambda$new$0$androidx-media3-exoplayer-rtsp-RtspMediaPeriod$RtpLoadInfo(RtspMediaPeriod.java:893)
    at androidx.media3.exoplayer.rtsp.RtspMediaPeriod$RtpLoadInfo$$ExternalSyntheticLambda0.onTransportReady(Unknown Source:2)
    at androidx.media3.exoplayer.rtsp.RtpDataLoadable.lambda$load$0$androidx-media3-exoplayer-rtsp-RtpDataLoadable(RtpDataLoadable.java:158)
    at androidx.media3.exoplayer.rtsp.RtpDataLoadable$$ExternalSyntheticLambda0.run(Unknown Source:6)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.os.HandlerThread.run(HandlerThread.java:67)

这个异常可以通过尝试捕获来捕获,或者如何避免它?

Java Android 异常 RTSP ExoPlayer

评论

0赞 Robert 9/17/2023
从堆栈跟踪中可以看出,不涉及任何应用代码,因此无法捕获。顺便说一句:你忘了提到使用过的 exoplayer 版本。

答: 暂无答案