diff --git a/library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java b/library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java index 395d9ba64d..f663457ce7 100644 --- a/library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java +++ b/library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java @@ -72,14 +72,16 @@ public class DashChunkSource implements ChunkSource { */ public DashChunkSource(DataSource dataSource, FormatEvaluator evaluator, Representation... representations) { + long periodDurationUs = (representations[0].periodDurationMs == -1) + ? -1 : representations[0].periodDurationMs * 1000; + this.dataSource = dataSource; this.evaluator = evaluator; this.formats = new Format[representations.length]; this.extractors = new HashMap(); this.segmentIndexes = new HashMap(); this.representations = new HashMap(); - this.trackInfo = new TrackInfo(representations[0].format.mimeType, - representations[0].periodDurationMs * 1000); + this.trackInfo = new TrackInfo(representations[0].format.mimeType, periodDurationUs); this.evaluation = new Evaluation(); int maxWidth = 0; int maxHeight = 0;