Commit b3f485d7 by olly Committed by Oliver Woodman

Add an additional sanity check to FakeExtractorOutput

PiperOrigin-RevId: 285422885
parent b7b3a158
......@@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertWithMessage;
import android.content.Context;
import android.util.SparseArray;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.extractor.ExtractorOutput;
import com.google.android.exoplayer2.extractor.SeekMap;
import java.io.File;
......@@ -69,6 +70,9 @@ public final class FakeExtractorOutput implements ExtractorOutput, Dumper.Dumpab
@Override
public void seekMap(SeekMap seekMap) {
if (seekMap.isSeekable() && seekMap.getDurationUs() == C.TIME_UNSET) {
throw new IllegalStateException("SeekMap cannot be seekable and have an unknown duration");
}
this.seekMap = seekMap;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment