Skip to content

Commit

Permalink
Fix bug where streamOffsetUs is passed instead of streamPositionUs
Browse files Browse the repository at this point in the history
Also make order of streamStartPositionUs and streamOffsetUs consistent

PiperOrigin-RevId: 487511633
  • Loading branch information
kim-vde authored and microkatz committed Nov 10, 2022
1 parent 4949fbe commit acfea39
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

public AudioTranscodingSamplePipeline(
Format inputFormat,
long streamOffsetUs,
long streamStartPositionUs,
long streamOffsetUs,
TransformationRequest transformationRequest,
Codec.DecoderFactory decoderFactory,
Codec.EncoderFactory encoderFactory,
Expand All @@ -65,8 +65,8 @@ public AudioTranscodingSamplePipeline(
throws TransformationException {
super(
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest.flattenForSlowMotion,
muxerWrapper);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

/* package */ abstract class BaseSamplePipeline implements SamplePipeline {

private final long streamOffsetUs;
private final long streamStartPositionUs;
private final long streamOffsetUs;
private final MuxerWrapper muxerWrapper;
private final @C.TrackType int trackType;
private final @MonotonicNonNull SefSlowMotionFlattener sefVideoSlowMotionFlattener;
Expand All @@ -42,12 +42,12 @@

public BaseSamplePipeline(
Format inputFormat,
long streamOffsetUs,
long streamStartPositionUs,
long streamOffsetUs,
boolean flattenForSlowMotion,
MuxerWrapper muxerWrapper) {
this.streamOffsetUs = streamOffsetUs;
this.streamStartPositionUs = streamStartPositionUs;
this.streamOffsetUs = streamOffsetUs;
this.muxerWrapper = muxerWrapper;
trackType = MimeTypes.getTrackType(inputFormat.sampleMimeType);
sefVideoSlowMotionFlattener =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
private final DecoderInputBuffer decoderInputBuffer;

private boolean isTransformationRunning;
private long streamOffsetUs;
private long streamStartPositionUs;
private long streamOffsetUs;
private @MonotonicNonNull SamplePipeline samplePipeline;

public ExoPlayerAssetLoaderRenderer(
Expand Down Expand Up @@ -110,8 +110,8 @@ public void render(long positionUs, long elapsedRealtimeUs) {

@Override
protected void onStreamChanged(Format[] formats, long startPositionUs, long offsetUs) {
this.streamOffsetUs = offsetUs;
this.streamStartPositionUs = startPositionUs;
this.streamOffsetUs = offsetUs;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@

public PassthroughSamplePipeline(
Format format,
long streamOffsetUs,
long streamStartPositionUs,
long streamOffsetUs,
TransformationRequest transformationRequest,
MuxerWrapper muxerWrapper,
FallbackListener fallbackListener) {
super(
format,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest.flattenForSlowMotion,
muxerWrapper);
this.format = format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private SamplePipeline getSamplePipeline(
if (MimeTypes.isAudio(inputFormat.sampleMimeType) && shouldTranscodeAudio(inputFormat)) {
return new AudioTranscodingSamplePipeline(
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest,
decoderFactory,
Expand All @@ -172,8 +172,8 @@ && shouldTranscodeVideo(inputFormat, streamStartPositionUs, streamOffsetUs)) {
return new VideoTranscodingSamplePipeline(
context,
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest,
videoEffects,
frameProcessorFactory,
Expand All @@ -186,8 +186,8 @@ && shouldTranscodeVideo(inputFormat, streamStartPositionUs, streamOffsetUs)) {
} else {
return new PassthroughSamplePipeline(
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest,
muxerWrapper,
fallbackListener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
public VideoTranscodingSamplePipeline(
Context context,
Format inputFormat,
long streamOffsetUs,
long streamStartPositionUs,
long streamOffsetUs,
TransformationRequest transformationRequest,
ImmutableList<Effect> effects,
FrameProcessor.Factory frameProcessorFactory,
Expand All @@ -80,8 +80,8 @@ public VideoTranscodingSamplePipeline(
throws TransformationException {
super(
inputFormat,
streamOffsetUs,
streamStartPositionUs,
streamOffsetUs,
transformationRequest.flattenForSlowMotion,
muxerWrapper);

Expand Down

0 comments on commit acfea39

Please sign in to comment.