androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.61k stars 380 forks source link

ExoPLayer:PLayback ArrayIndexOutOfBoundsException #392

Closed SogYa closed 12 months ago

SogYa commented 1 year ago

I connect to my camera via rtsp and when creating mediateam, a crash occurs with the arrayindexofbounds error. The connection to the camera goes through VLC normally, there is no error in the address

rtspUri = "rtsp://192.168.1.166:554/1"
                    player?.setMediaItem(MediaItem.fromUri(rtspUri!!))
                    player?.play()

Media3 Version

Media3 1.0.1

Devices that reproduce the issue

All devices

Devices that do not reproduce the issue

none

Reproducible in the demo app?

Not tested

Reproduction steps

create media item with rtsp uri

Expected result

the media plays succesful

Actual result

stack trace: FATAL EXCEPTION: ExoPlayer:Playback Process: ru.sogya.work.camera_controll, PID: 7457 java.lang.ArrayIndexOutOfBoundsException: length=42; index=42 at androidx.media3.common.util.ParsableNalUnitBitArray.readBit(ParsableNalUnitBitArray.java:124) at androidx.media3.common.util.ParsableNalUnitBitArray.readExpGolombCodeNum(ParsableNalUnitBitArray.java:193) at androidx.media3.common.util.ParsableNalUnitBitArray.readSignedExpGolombCodedInt(ParsableNalUnitBitArray.java:187) at androidx.media3.common.util.NalUnitUtil.skipH265ScalingList(NalUnitUtil.java:848) at androidx.media3.common.util.NalUnitUtil.parseH265SpsNalUnitPayload(NalUnitUtil.java:606) at androidx.media3.common.util.NalUnitUtil.parseH265SpsNalUnit(NalUnitUtil.java:525) at androidx.media3.exoplayer.rtsp.RtspMediaTrack.processH265FmtpAttribute(RtspMediaTrack.java:449) at androidx.media3.exoplayer.rtsp.RtspMediaTrack.generatePayloadFormat(RtspMediaTrack.java:269) at androidx.media3.exoplayer.rtsp.RtspMediaTrack.<init>(RtspMediaTrack.java:164) at androidx.media3.exoplayer.rtsp.RtspClient.buildTrackList(RtspClient.java:352) at androidx.media3.exoplayer.rtsp.RtspClient.access$1700(RtspClient.java:76) at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.onDescribeResponseReceived(RtspClient.java:711) at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspResponse(RtspClient.java:619) at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.handleRtspMessage(RtspClient.java:512) at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener.lambda$onRtspMessageReceived$0$androidx-media3-exoplayer-rtsp-RtspClient$MessageListener(RtspClient.java:505) at androidx.media3.exoplayer.rtsp.RtspClient$MessageListener$$ExternalSyntheticLambda0.run(Unknown Source:4) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.os.HandlerThread.run(HandlerThread.java:67)

Media

Not applicable

Bug Report

microkatz commented 1 year ago

@SogYa.

Thank you for reporting your issue! Based on the stack trace snippet. It seems that there is some issue in parsing the H265_SPROP_SPS value from the SDP payload in the RTSP DESCRIBE Response. It would be helpful if you could provide the RTSP Describe Response message for us to debug?

You can do the following to get ExoPlayer to log the Describe Response message to send to us.

After completing the above two steps, please create a bug report. If you're unable to share it publicly, then please send it to dev.exoplayer@gmail.com using a subject in the format "Issue #392". Please also update this issue to indicate you've done this.