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.75k stars 6.03k forks source link

HLS (vod) ArrayIndexOutOfBoundsException #2234

Closed megamind-android closed 7 years ago

megamind-android commented 7 years ago
12-20 02:42:24.534 14027-15060/com.bifrost E/ExoPlayerImplInternal: Internal runtime error.
                                                                    java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
                                                                        at com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper.selectTracks(HlsSampleStreamWrapper.java:211)
                                                                        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.selectTracks(HlsMediaPeriod.java:171)
                                                                        at com.google.android.exoplayer2.ExoPlayerImplInternal$MediaPeriodHolder.updatePeriodTrackSelection(ExoPlayerImplInternal.java:1271)
                                                                        at com.google.android.exoplayer2.ExoPlayerImplInternal$MediaPeriodHolder.updatePeriodTrackSelection(ExoPlayerImplInternal.java:1258)
                                                                        at com.google.android.exoplayer2.ExoPlayerImplInternal$MediaPeriodHolder.handlePrepared(ExoPlayerImplInternal.java:1243)
                                                                        at com.google.android.exoplayer2.ExoPlayerImplInternal.handlePeriodPrepared(ExoPlayerImplInternal.java:1054)
                                                                        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:281)
                                                                        at android.os.Handler.dispatchMessage(Handler.java:98)
                                                                        at android.os.Looper.loop(Looper.java:148)
                                                                        at android.os.HandlerThread.run(HandlerThread.java:61)
                                                                        at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)

We are using Red5Pro as media server. We are getting the above exception when we tried to play their HLS vod.

We are using exoplayer(2.1.0) version. Below is the example url which reproduces the above issue https://d1li84u6vkc79u.cloudfront.net/vods/58591d2648154365365a323c/58591d2648154365365a323c.m3u8

ojw28 commented 7 years ago

This is an issue with the source content. The first media segment doesn't include any audio. In the second media segment this additional track belatedly "appears". The first media segment should include audio, even if it's silence. You should ask the Red5 people to fix this.