Skip to content

Commit

Permalink
fix: faulty audio map-uri due to wrong index var (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfrederiksen committed Apr 18, 2023
1 parent 291c60a commit d6c773b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class HLSSpliceVod {
while (pos < offset && idx < playlist.items.PlaylistItem.length) {
const plItem = playlist.items.PlaylistItem[idx];
if (plItem.get("map-uri")) {
closestCmafMapUri = this._getCmafMapUri(playlist, this.masterManifestUri, this.baseUrl, i);
closestCmafMapUri = this._getCmafMapUri(playlist, this.masterManifestUri, this.baseUrl, idx);
}
pos += plItem.get("duration") * 1000;
idx++;
Expand All @@ -309,7 +309,7 @@ class HLSSpliceVod {
if (!isPostRoll) {
playlist.items.PlaylistItem[idx + adLength].set("discontinuity", true);
}
if (closestCmafMapUri) {
if (closestCmafMapUri && !playlist.items.PlaylistItem[idx + adLength].get("cueout")) {
playlist.items.PlaylistItem[idx + adLength].set("map-uri", closestCmafMapUri);
}
} else {
Expand Down

0 comments on commit d6c773b

Please sign in to comment.