Skip to content

Commit

Permalink
feat: pipelining slate
Browse files Browse the repository at this point in the history
  • Loading branch information
birme committed Aug 29, 2023
1 parent 4170417 commit 2bbf47a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions engine/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -1275,15 +1275,19 @@ class Session {
lastDiscontinuityAudio = currentVod.getLastDiscontinuityAudio();
}
const isLeader = await this._sessionStateStore.isLeader(this._instanceId);
await this._sessionState.set("vodMediaSeqVideo", 0);
await this._sessionState.set("vodMediaSeqAudio", 0);
await this._sessionState.set("state", SessionState.VOD_NEXT_INITIATING);

const updatedSessionState = await this._sessionState.setValues({
"vodMediaSeqVideo": 0,
"vodMediaSeqAudio": 0,
"state": SessionState.VOD_NEXT_INITIATING,
"mediaSeq": sessionState.mediaSeq + endValue,
"mediaSeqAudio": sessionState.mediaSeqAudio + endValueAudio,
"discSeq": sessionState.discSeq + lastDiscontinuity,
"discSeqAudio": sessionState.discSeqAudio + lastDiscontinuityAudio,
"slateCount": sessionState.slateCount + 1
});
sessionState = { ...sessionState, ...updatedSessionState };
await this._sessionState.setCurrentVod(slateVod);
await this._sessionState.set("mediaSeq", sessionState.mediaSeq + endValue);
await this._sessionState.set("mediaSeqAudio", sessionState.mediaSeqAudio + endValueAudio);
await this._sessionState.set("discSeq", sessionState.discSeq + lastDiscontinuity);
await this._sessionState.set("discSeqAudio", sessionState.discSeqAudio + lastDiscontinuityAudio);
await this._sessionState.set("slateCount", sessionState.slateCount + 1);
this.currentPlayheadRef = await this._playheadState.set("playheadRef", Date.now(), isLeader);

cloudWatchLog(!this.cloudWatchLogging, 'engine-session', { event: 'slateInserted', channel: this._sessionId });
Expand Down

0 comments on commit 2bbf47a

Please sign in to comment.