Skip to content

ExoPlayer2 crashes when fetching a Dash manifest with no SegmentTimeline items (yet) #1865

Closed

Description

When doing a live broadcast, and the transmission just started, the Dash manifest may have an empty SegmentTimeline (while the first chunk is getting filled). ExoPlayer2 crashes on that moment.

This is the manifest I'm testing:

<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="urn:mpeg:dash:schema:mpd:2011"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
    profiles="urn:mpeg:dash:profile:isoff-live:2011"
    type="dynamic"
    minimumUpdatePeriod="PT0S"
    suggestedPresentationDelay="PT0S"
    publishTime="2016-09-27T16:48:01"
    timeShiftBufferDepth="PT0.0S"
    minBufferTime="PT0.0S">
    <ProgramInformation>
    </ProgramInformation>
    <Period start="PT0.0S">
        <AdaptationSet contentType="video" segmentAlignment="true" bitstreamSwitching="true" frameRate="90000/1">
            <Representation id="0" mimeType="video/mp4" codecs="avc1.640034" bandwidth="1000000" width="1280" height="720" frameRate="90000/1">
                <SegmentTemplate timescale="90000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
        <AdaptationSet contentType="audio" segmentAlignment="true" bitstreamSwitching="true">
            <Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audioSamplingRate="44100">
                <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
                <SegmentTemplate timescale="44100" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
    </Period>
</MPD>

And here is an example of the stack trace I'm getting:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      at java.util.ArrayList.get(ArrayList.java:411)
      at com.google.android.exoplayer2.source.dash.manifest.SegmentBase$MultiSegmentBase.getSegmentTimeUs(SegmentBase.java:190)
      at com.google.android.exoplayer2.source.dash.manifest.Representation$MultiSegmentRepresentation.getTimeUs(Representation.java:257)
      at com.google.android.exoplayer2.source.dash.DashMediaSource$PeriodSeekInfo.createPeriodSeekInfo(DashMediaSource.java:493)
      at com.google.android.exoplayer2.source.dash.DashMediaSource.processManifest(DashMediaSource.java:359)
      at com.google.android.exoplayer2.source.dash.DashMediaSource.processManifestAndScheduleRefresh(DashMediaSource.java:341)
      at com.google.android.exoplayer2.source.dash.DashMediaSource.onManifestLoadCompleted(DashMediaSource.java:251)
      at com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback.onLoadCompleted(DashMediaSource.java:589)
      at com.google.android.exoplayer2.source.dash.DashMediaSource$ManifestCallback.onLoadCompleted(DashMediaSource.java:583)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions