Fix HardwareCorrectionOffsetClock breaking ElapsedTime readings

This commit is contained in:
Dean Herbert 2020-06-14 11:33:59 +09:00
parent a8e83c5be5
commit 7b95c55afb
1 changed files with 3 additions and 2 deletions

View File

@ -251,8 +251,9 @@ private void removeSourceClockAdjustments()
private class HardwareCorrectionOffsetClock : FramedOffsetClock
{
// we always want to apply the same real-time offset, so it should be adjusted by the playback rate to achieve this.
public override double CurrentTime => SourceTime + Offset * Rate;
// we always want to apply the same real-time offset, so it should be adjusted by the difference in playback rate (from realtime) to achieve this.
// base implementation already adds offset at 1.0 rate, so we only add the difference from that here.
public override double CurrentTime => base.CurrentTime + Offset * (1 - Rate);
public HardwareCorrectionOffsetClock(IClock source, bool processSource = true)
: base(source, processSource)