diff --git a/library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java b/library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java index db772df855..3c26842d09 100644 --- a/library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java +++ b/library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java @@ -149,12 +149,11 @@ public class MediaPresentationDescriptionParser extends DefaultHandler } } while (!ParserUtil.isEndTag(xpp, "MPD")); - if (!dynamic && durationMs == -1) { - // The manifest is static and doesn't define a duration. This is unexpected. + if (durationMs == -1) { if (nextPeriodStartMs != -1) { // If we know the end time of the final period, we can use it as the duration. durationMs = nextPeriodStartMs; - } else { + } else if (!dynamic) { throw new ParserException("Unable to determine duration of static manifest."); } }