Skip to content

Commit 0d9a4fa

Browse files
committed
fix: sorting of timelineObjects
1 parent 858527c commit 0d9a4fa

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/job-worker/src/playout/lookahead/findForLayer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export function findLookaheadForLayer(
5151

5252
if (partInstancesInfo.current.onTimeline) {
5353
res.timed.push(...currentObjs)
54+
} else {
55+
res.future.push(...currentObjs)
5456
}
5557
previousPart = currentPartInfo.part
5658
}
@@ -68,6 +70,8 @@ export function findLookaheadForLayer(
6870
)
6971

7072
if (partInstancesInfo.next?.onTimeline) {
73+
res.timed.push(...nextObjs)
74+
} else {
7175
res.future.push(...nextObjs)
7276
}
7377
previousPart = nextPartInfo.part
@@ -101,7 +105,7 @@ function generatePartInstanceLookaheads(
101105
): { objs: LookaheadTimelineObject[]; partInfo: PartAndPieces } {
102106
const partInfo: PartAndPieces = {
103107
part: partInstanceInfo.part.part,
104-
usesInTransition: partInstanceInfo.calculatedTimings.inTransitionStart !== null,
108+
usesInTransition: partInstanceInfo.calculatedTimings?.inTransitionStart ? true : false,
105109
pieces: sortPieceInstancesByStart(partInstanceInfo.allPieces, partInstanceInfo.nowInPart),
106110
}
107111

packages/job-worker/src/playout/lookahead/findObjects.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function findLookaheadObjectsForPart(
9191
_context: JobContext,
9292
currentPartInstanceId: PartInstanceId | null,
9393
layer: string,
94-
previousPart: ReadonlyDeep<DBPart> | undefined,
94+
partBefore: ReadonlyDeep<DBPart> | undefined,
9595
partInfo: PartAndPieces,
9696
partInstanceId: PartInstanceId | null,
9797
nextTimeOffset?: number
@@ -120,8 +120,8 @@ export function findLookaheadObjectsForPart(
120120
}
121121

122122
let classesFromPreviousPart: readonly string[] = []
123-
if (previousPart && currentPartInstanceId && partInstanceId) {
124-
classesFromPreviousPart = previousPart.classesForNext || []
123+
if (partBefore && currentPartInstanceId && partInstanceId) {
124+
classesFromPreviousPart = partBefore.classesForNext || []
125125
}
126126

127127
const transitionPiece = partInfo.usesInTransition

0 commit comments

Comments
 (0)