mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Avoid seeking if seekPosition==currentPosition
This commit is contained in:
parent
eb1210d410
commit
360d452dad
1 changed files with 3 additions and 2 deletions
|
|
@ -228,11 +228,12 @@ public class HlsSampleSource implements SampleSource, Loader.Callback {
|
||||||
public void seekToUs(long positionUs) {
|
public void seekToUs(long positionUs) {
|
||||||
Assertions.checkState(prepared);
|
Assertions.checkState(prepared);
|
||||||
Assertions.checkState(enabledTrackCount > 0);
|
Assertions.checkState(enabledTrackCount > 0);
|
||||||
downstreamPositionUs = positionUs;
|
|
||||||
lastSeekPositionUs = positionUs;
|
lastSeekPositionUs = positionUs;
|
||||||
if (pendingResetPositionUs == positionUs) {
|
if (pendingResetPositionUs == positionUs || downstreamPositionUs == positionUs) {
|
||||||
|
downstreamPositionUs = positionUs;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
downstreamPositionUs = positionUs;
|
||||||
for (int i = 0; i < pendingDiscontinuities.length; i++) {
|
for (int i = 0; i < pendingDiscontinuities.length; i++) {
|
||||||
pendingDiscontinuities[i] = true;
|
pendingDiscontinuities[i] = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue