Skip to content

Commit

Permalink
Fix ClippingSampleStream
Browse files Browse the repository at this point in the history
  • Loading branch information
ojw28 committed Jan 3, 2018
1 parent f657893 commit f8c76f6
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public long selectTracks(TrackSelection[] selections, boolean[] mayRetainStreamF
if (internalStreams[i] == null) {
sampleStreams[i] = null;
} else if (streams[i] == null || sampleStreams[i].stream != internalStreams[i]) {
sampleStreams[i] = new ClippingSampleStream(this, internalStreams[i], startUs, endUs,
sampleStreams[i] = new ClippingSampleStream(internalStreams[i], startUs, endUs,
pendingInitialDiscontinuity);
}
streams[i] = sampleStreams[i];
Expand Down Expand Up @@ -222,19 +222,17 @@ private static boolean shouldKeepInitialDiscontinuity(TrackSelection[] selection
/**
* Wraps a {@link SampleStream} and clips its samples.
*/
private static final class ClippingSampleStream implements SampleStream {
private final class ClippingSampleStream implements SampleStream {

private final MediaPeriod mediaPeriod;
private final SampleStream stream;
private final long startUs;
private final long endUs;

private boolean pendingDiscontinuity;
private boolean sentEos;

public ClippingSampleStream(MediaPeriod mediaPeriod, SampleStream stream, long startUs,
long endUs, boolean pendingDiscontinuity) {
this.mediaPeriod = mediaPeriod;
public ClippingSampleStream(SampleStream stream, long startUs, long endUs,
boolean pendingDiscontinuity) {
this.stream = stream;
this.startUs = startUs;
this.endUs = endUs;
Expand Down

0 comments on commit f8c76f6

Please sign in to comment.