ExtractorMediaPeriod: Use URI sha1 hash as the DataSpec key.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130422264
This commit is contained in:
eguven 2016-08-16 11:06:48 -07:00 committed by Oliver Woodman
parent 7bed85950e
commit 671a15badf

View file

@ -38,6 +38,7 @@ import com.google.android.exoplayer2.upstream.Loader;
import com.google.android.exoplayer2.upstream.Loader.Loadable;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.ConditionVariable;
import com.google.android.exoplayer2.util.Util;
import java.io.EOFException;
import java.io.IOException;
import java.util.Arrays;
@ -558,7 +559,8 @@ import java.util.Arrays;
ExtractorInput input = null;
try {
long position = positionHolder.position;
length = dataSource.open(new DataSpec(uri, position, C.LENGTH_UNBOUNDED, null));
length = dataSource.open(
new DataSpec(uri, position, C.LENGTH_UNBOUNDED, Util.sha1(uri.toString())));
if (length != C.LENGTH_UNBOUNDED) {
length += position;
}