AudioTrackPositionTracker: Prevent negative timestamps
Issue: #7456 PiperOrigin-RevId: 314408767
This commit is contained in:
parent
79acadcc89
commit
fb011e66a6
@ -11,8 +11,9 @@
|
|||||||
* Fix "Not allowed to start service" `IllegalStateException` in
|
* Fix "Not allowed to start service" `IllegalStateException` in
|
||||||
`DownloadService`
|
`DownloadService`
|
||||||
([#7306](https://github.com/google/ExoPlayer/issues/7306)).
|
([#7306](https://github.com/google/ExoPlayer/issues/7306)).
|
||||||
* Ads:
|
* Fix issue in `AudioTrackPositionTracker` that could cause negative positions
|
||||||
* Fix `AdsMediaSource` child `MediaSource`s not being released.
|
to be reported at the start of playback and immediately after seeking
|
||||||
|
([#7456](https://github.com/google/ExoPlayer/issues/7456).
|
||||||
* DASH:
|
* DASH:
|
||||||
* Merge trick play adaptation sets (i.e., adaptation sets marked with
|
* Merge trick play adaptation sets (i.e., adaptation sets marked with
|
||||||
`http://dashif.org/guidelines/trickmode`) into the same `TrackGroup` as
|
`http://dashif.org/guidelines/trickmode`) into the same `TrackGroup` as
|
||||||
@ -58,6 +59,7 @@
|
|||||||
([#5444](https://github.com/google/ExoPlayer/issues/5444),
|
([#5444](https://github.com/google/ExoPlayer/issues/5444),
|
||||||
[#5966](https://github.com/google/ExoPlayer/issues/5966),
|
[#5966](https://github.com/google/ExoPlayer/issues/5966),
|
||||||
[#7002](https://github.com/google/ExoPlayer/issues/7002)).
|
[#7002](https://github.com/google/ExoPlayer/issues/7002)).
|
||||||
|
* Fix `AdsMediaSource` child `MediaSource`s not being released.
|
||||||
* Cronet extension: Default to using the Cronet implementation in Google Play
|
* Cronet extension: Default to using the Cronet implementation in Google Play
|
||||||
Services rather than Cronet Embedded. This allows Cronet to be used with a
|
Services rather than Cronet Embedded. This allows Cronet to be used with a
|
||||||
negligible increase in application size, compared to approximately 8MB when
|
negligible increase in application size, compared to approximately 8MB when
|
||||||
|
@ -206,6 +206,7 @@ import java.lang.reflect.Method;
|
|||||||
hasData = false;
|
hasData = false;
|
||||||
stopTimestampUs = C.TIME_UNSET;
|
stopTimestampUs = C.TIME_UNSET;
|
||||||
forceResetWorkaroundTimeMs = C.TIME_UNSET;
|
forceResetWorkaroundTimeMs = C.TIME_UNSET;
|
||||||
|
lastLatencySampleTimeUs = 0;
|
||||||
latencyUs = 0;
|
latencyUs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +240,7 @@ import java.lang.reflect.Method;
|
|||||||
positionUs = systemTimeUs + smoothedPlayheadOffsetUs;
|
positionUs = systemTimeUs + smoothedPlayheadOffsetUs;
|
||||||
}
|
}
|
||||||
if (!sourceEnded) {
|
if (!sourceEnded) {
|
||||||
positionUs -= latencyUs;
|
positionUs = Math.max(0, positionUs - latencyUs);
|
||||||
}
|
}
|
||||||
return positionUs;
|
return positionUs;
|
||||||
}
|
}
|
||||||
@ -353,7 +354,7 @@ import java.lang.reflect.Method;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the position tracker. Should be called when the audio track previous passed to {@link
|
* Resets the position tracker. Should be called when the audio track previously passed to {@link
|
||||||
* #setAudioTrack(AudioTrack, int, int, int)} is no longer in use.
|
* #setAudioTrack(AudioTrack, int, int, int)} is no longer in use.
|
||||||
*/
|
*/
|
||||||
public void reset() {
|
public void reset() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user