google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

RTSP error not handled by Listener.onPlayerError, app crashes on invalid media #10165

Closed ArtRoman closed 2 years ago

ArtRoman commented 2 years ago

ExoPlayer Version

2.17.1

Devices that reproduce the issue

Any device, I think. Reproduces on emulator with Android 11 (R) and Asus Tinkerboard with Android 7 (N).

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

Start RTSP stream: rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_175k.mov Stream is missing some data because server was about to close starting this year, but URL is still accessible.

Expected result

RTSP stream is missing some data, so playback should stop, ExoException should raise via onPlayerError(PlaybackException error) if listener is set

Actual result

App crashes with error in log tagged by AndroidRuntime:

 FATAL EXCEPTION: ExoPlayer:Playback
 Process: *****, PID: 29242
 java.lang.IllegalArgumentException
    at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
    at com.google.android.exoplayer2.source.rtsp.RtspSessionTiming.parseTiming(RtspSessionTiming.java:66)
    at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener.onDescribeResponseReceived(RtspClient.java:683)
    at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener.handleRtspResponse(RtspClient.java:598)
    at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener.handleRtspMessage(RtspClient.java:507)
    at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener.lambda$onRtspMessageReceived$0$com-google-android-exoplayer2-source-rtsp-RtspClient$MessageListener(RtspClient.java:500)
    at com.google.android.exoplayer2.source.rtsp.RtspClient$MessageListener$$ExternalSyntheticLambda0.run(Unknown Source:4)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.os.HandlerThread.run(HandlerThread.java:67)

RtspSessionTiming.java:66 is

      checkArgument(stopTimeMs > startTimeMs);

both values are set to 0.

Media

rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_175k.mov

Bug Report

ojw28 commented 2 years ago

@claincly - Please take a look

claincly commented 2 years ago

I can't connect to the link provided via both VLC and ExoPlayer. A fix is on the way.