From 2e1f9897e76005978444eb617a862c1cdfa6b5c1 Mon Sep 17 00:00:00 2001 From: Oliver Woodman Date: Wed, 3 Dec 2014 18:30:56 +0000 Subject: [PATCH] Fixed issue in which setting a representation duration to unknown wasn't handled correctly. --- .../com/google/android/exoplayer/dash/DashChunkSource.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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;