mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Remove weird nextOffset state from SampleMetadataQueue
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=159681714
This commit is contained in:
parent
9154d54df9
commit
59ccd63544
1 changed files with 6 additions and 7 deletions
|
|
@ -55,7 +55,6 @@ import com.google.android.exoplayer2.util.Util;
|
|||
private int relativeStartIndex;
|
||||
private int readPosition;
|
||||
|
||||
private long nextOffset;
|
||||
private long largestDequeuedTimestampUs;
|
||||
private long largestQueuedTimestampUs;
|
||||
private boolean upstreamKeyframeRequired;
|
||||
|
|
@ -249,8 +248,6 @@ import com.google.android.exoplayer2.util.Util;
|
|||
|
||||
largestDequeuedTimestampUs = Math.max(largestDequeuedTimestampUs, buffer.timeUs);
|
||||
readPosition++;
|
||||
nextOffset = extrasHolder.offset + extrasHolder.size;
|
||||
|
||||
return C.RESULT_BUFFER_READ;
|
||||
}
|
||||
|
||||
|
|
@ -298,7 +295,6 @@ import com.google.android.exoplayer2.util.Util;
|
|||
}
|
||||
|
||||
readPosition += sampleCountToKeyframe;
|
||||
nextOffset = offsets[(relativeStartIndex + readPosition) % capacity];
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -310,8 +306,6 @@ import com.google.android.exoplayer2.util.Util;
|
|||
return;
|
||||
}
|
||||
readPosition = length;
|
||||
int relativeLastSampleIndex = (relativeStartIndex + readPosition - 1) % capacity;
|
||||
nextOffset = offsets[relativeLastSampleIndex] + sizes[relativeLastSampleIndex];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -331,7 +325,12 @@ import com.google.android.exoplayer2.util.Util;
|
|||
relativeStartIndex -= capacity;
|
||||
}
|
||||
readPosition = 0;
|
||||
return length == 0 ? nextOffset : offsets[relativeStartIndex];
|
||||
if (length == 0) {
|
||||
int relativeLastDiscardedIndex = (relativeStartIndex - 1 + capacity) % capacity;
|
||||
return offsets[relativeLastDiscardedIndex] + sizes[relativeLastDiscardedIndex];
|
||||
} else {
|
||||
return offsets[relativeStartIndex];
|
||||
}
|
||||
}
|
||||
|
||||
// Called by the loading thread.
|
||||
|
|
|
|||
Loading…
Reference in a new issue