37 case 1:
case 2:
case 3:
case 4:
case 5:
38 case 6:
case 7:
case 8:
case 9:
case 10:
47 if (result.timeMultiple_ == 0)
51 if (result.endingAction_ > 3)
70 result.clock_ =
static_cast<std::int32_t
>(
initial);
71 result.videoClock_ = record.
chunk.
id == 6;
72 result.soundClock_ = record.
chunk.
id == 5;
73 result.elapsedParentClock_ = result.clock_;
74 result.authoredEndTime_ = result.endTime_;
81 ClockUpdate result{
false, clock_, clock_,
false,
false,
false, stopped_ };
82 if (stopped_)
return result;
83 if (lastParentClock_ &&
parentClock < *lastParentClock_)
86 std::int64_t
elapsed = lastParentClock_ ?
87 static_cast<std::int64_t
>(
parentClock) - *lastParentClock_ : 0;
93 elapsedParentClock_ =
static_cast<std::int32_t
>(
parentElapsed);
94 result.updated = !lastParentClock_ ||
forceReevaluation || pendingVideoClock_.has_value();
95 if (!lastParentClock_) result.previousClock.reset();
97 if (pendingVideoClock_)
99 const auto supplied = *pendingVideoClock_;
100 pendingVideoClock_.reset();
101 endTime_ = std::min(authoredEndTime_,
supplied.duration);
103 (authoredEndTime_ <
supplied.duration &&
supplied.clock >= authoredEndTime_);
106 result.hitEnd = !videoHeld_ || endingAction_ != 2;
107 result.notifyEnd = result.hitEnd;
109 if (endingAction_ <= 1) stopped_ =
true;
110 else if (endingAction_ == 2) videoHeld_ =
true;
115 result.restartChildren =
true;
123 if (
mediaClock < clock_) result.restartChildren =
true;
128 result.clock = clock_;
129 result.stopped = stopped_;
135 if (!dropFrames_ &&
elapsed > timeMultiple_)
elapsed = timeMultiple_;
136 auto next =
static_cast<std::int64_t
>(clock_) +
elapsed;
140 if (pendingSoundClock_)
142 next = *pendingSoundClock_;
144 if (
next == endTime_ - 1)
next = endTime_;
145 if (lastParentClock_ &&
next < clock_) result.restartChildren =
true;
146 pendingSoundClock_.reset();
151 result.updated =
true;
152 if (!lastParentClock_) result.previousClock.reset();
153 clock_ =
static_cast<std::int32_t
>(
next);
155 if (clock_ >= endTime_ || endingAction_ == 0)
157 result.hitEnd =
true;
158 result.notifyEnd = endingAction_ != 2 ||
159 !result.previousClock || *result.previousClock < endTime_;
160 if (endingAction_ <= 1) stopped_ =
true;
161 else if (endingAction_ == 2)
167 else if (!soundClock_)
172 result.restartChildren =
true;
175 result.clock = clock_;
176 result.stopped = stopped_;