Commit 15543f13 by aquilescanta Committed by Oliver Woodman

Decouple TrackGroups from SampleQueues in HlsSampleStreamWrapper

This CL does not aim to introduce any functionality changes.

Issue:#3149

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174864875
parent 98301467
...@@ -21,22 +21,22 @@ import com.google.android.exoplayer2.source.SampleStream; ...@@ -21,22 +21,22 @@ import com.google.android.exoplayer2.source.SampleStream;
import java.io.IOException; import java.io.IOException;
/** /**
* {@link SampleStream} for a particular track group in HLS. * {@link SampleStream} for a particular sample queue in HLS.
*/ */
/* package */ final class HlsSampleStream implements SampleStream { /* package */ final class HlsSampleStream implements SampleStream {
public final int group; public final int sampleQueueIndex;
private final HlsSampleStreamWrapper sampleStreamWrapper; private final HlsSampleStreamWrapper sampleStreamWrapper;
public HlsSampleStream(HlsSampleStreamWrapper sampleStreamWrapper, int group) { public HlsSampleStream(HlsSampleStreamWrapper sampleStreamWrapper, int sampleQueueIndex) {
this.sampleStreamWrapper = sampleStreamWrapper; this.sampleStreamWrapper = sampleStreamWrapper;
this.group = group; this.sampleQueueIndex = sampleQueueIndex;
} }
@Override @Override
public boolean isReady() { public boolean isReady() {
return sampleStreamWrapper.isReady(group); return sampleStreamWrapper.isReady(sampleQueueIndex);
} }
@Override @Override
...@@ -46,12 +46,12 @@ import java.io.IOException; ...@@ -46,12 +46,12 @@ import java.io.IOException;
@Override @Override
public int readData(FormatHolder formatHolder, DecoderInputBuffer buffer, boolean requireFormat) { public int readData(FormatHolder formatHolder, DecoderInputBuffer buffer, boolean requireFormat) {
return sampleStreamWrapper.readData(group, formatHolder, buffer, requireFormat); return sampleStreamWrapper.readData(sampleQueueIndex, formatHolder, buffer, requireFormat);
} }
@Override @Override
public int skipData(long positionUs) { public int skipData(long positionUs) {
return sampleStreamWrapper.skipData(group, positionUs); return sampleStreamWrapper.skipData(sampleQueueIndex, positionUs);
} }
} }
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