Skip to content

Crash when selecting subtitle in multi-period DASH. #10940

@zilinx

Description

@zilinx

ExoPlayer Version

2.18.2

Devices that reproduce the issue

Probably any device. I used Samsung Galaxy S10 (Android 12) and Google TV HD (Android 11) for development.

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

This issue was could not be reproduced in version 2.18.1.

When trying to select the text track, the application crashes (reproducible at about 95% rate).

Steps to reproduce with the sample app:

  1. Load an mpd which has multiple <Period>s and a ttml track.
  2. Start the stream
  3. Select the text track from the CC menu at the bottom or Select Tracks > Text on the top.

Expected result

The video plays with the selected subtitle showing.

Actual result

The app crashes with ArrayIndexOutOfBoundsException in TtmlSubtitle:

Playback error
  com.google.android.exoplayer2.ExoPlaybackException: Unexpected runtime error
      at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:621)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loopOnce(Looper.java:226)
      at android.os.Looper.loop(Looper.java:313)
      at android.os.HandlerThread.run(HandlerThread.java:67)
  Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1
      at com.google.android.exoplayer2.text.ttml.TtmlSubtitle.getEventTime(TtmlSubtitle.java:62)
      at com.google.android.exoplayer2.text.SubtitleOutputBuffer.getEventTime(SubtitleOutputBuffer.java:53)
      at com.google.android.exoplayer2.text.TextRenderer.getCurrentEventTimeUs(TextRenderer.java:426)
      at com.google.android.exoplayer2.text.TextRenderer.render(TextRenderer.java:259)
      at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:994)
      at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:495)
      at android.os.Handler.dispatchMessage(Handler.java:102) 
      at android.os.Looper.loopOnce(Looper.java:226) 
      at android.os.Looper.loop(Looper.java:313) 
      at android.os.HandlerThread.run(HandlerThread.java:67) 

Media

I will send a sample by email.

Bug Report

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions