Fix bug in FakeChunkSource.

In order to retrieve the data set, the track selection index was used, but
the data set is actually indexed by track group indices.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167566049
This commit is contained in:
tonihei 2017-09-05 05:23:22 -07:00 committed by Oliver Woodman
parent bec5e6e2b2
commit 264f1c903d

View file

@ -92,7 +92,8 @@ public final class FakeChunkSource implements ChunkSource {
Format selectedFormat = trackSelection.getSelectedFormat();
long startTimeUs = dataSet.getStartTime(chunkIndex);
long endTimeUs = startTimeUs + dataSet.getChunkDuration(chunkIndex);
String uri = dataSet.getUri(trackSelection.getSelectedIndex());
int trackGroupIndex = trackSelection.getIndexInTrackGroup(trackSelection.getSelectedIndex());
String uri = dataSet.getUri(trackGroupIndex);
Segment fakeDataChunk = dataSet.getData(uri).getSegments().get(chunkIndex);
DataSpec dataSpec = new DataSpec(Uri.parse(uri), fakeDataChunk.byteOffset,
fakeDataChunk.length, null);