Skip to content

Commit

Permalink
Merge branch 'master' into fix/independent-subtitle-playhead
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfrederiksen committed Nov 21, 2023
2 parents 14be00f + 62e6561 commit f2f5d33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 37 deletions.
34 changes: 0 additions & 34 deletions engine/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -2100,40 +2100,6 @@ class Session {
}
return false;
}

async _determineExtraMediaIncrement(_extraType, _currentPosVideo, _extraSeqFinalIndex, _vodMediaSeqExtra, _getExtraPlayheadPositionAsyncFn) {
debug(`[${this._sessionId}]: About to determine ${_extraType} increment. Video increment has already been executed.`);
let extraMediaIncrement = 0;
let positionV = _currentPosVideo ? _currentPosVideo / 1000 : 0;
let positionX;
let posDiff;
const threshold = 0.500;
while (extraMediaIncrement < _extraSeqFinalIndex) {
const currentPosExtraMedia = (await _getExtraPlayheadPositionAsyncFn(_vodMediaSeqExtra + extraMediaIncrement)) * 1000;
positionX = currentPosExtraMedia ? currentPosExtraMedia / 1000 : 0;
posDiff = (positionV - positionX).toFixed(3);
debug(`[${this._sessionId}]: positionV=${positionV};position${_extraType === "audio" ? "A" : "S"}=${positionX};posDiff=${posDiff}`);
if (isNaN(posDiff)) {
break;
}
if (positionX >= positionV) {
break;
}
const difference = Math.abs(posDiff);
if (difference > threshold && difference > Number.EPSILON) {
// Video position ahead of audio|sub position, further increment needed...
extraMediaIncrement++;
} else {
debug(`[${this._sessionId}]: Difference(${difference}) is acceptable; IncrementValue=${extraMediaIncrement}`);
break;
}
}
return {
increment: extraMediaIncrement,
position: positionX,
diff: posDiff
};
}
}

module.exports = Session;
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eyevinn-channel-engine",
"version": "4.3.7",
"version": "4.3.8",
"description": "OTT TV Channel Engine",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit f2f5d33

Please sign in to comment.