Skip to content

Commit

Permalink
Fix 608 caption TextTrack Cue seek/discontinuity timing regression in…
Browse files Browse the repository at this point in the history
…troduced in v1.5.0 with #5557
  • Loading branch information
robwalch committed May 23, 2024
1 parent 4415c67 commit 346a8b9
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/controller/timeline-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,20 +466,17 @@ export class TimelineController implements ComponentAPI {
// if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack
if (this.enabled && data.frag.type === PlaylistLevelType.MAIN) {
const { cea608Parser1, cea608Parser2, lastSn } = this;
if (!cea608Parser1 || !cea608Parser2) {
return;
}
const { cc, sn } = data.frag;
const partIndex = data.part?.index ?? -1;
if (
!(
sn === lastSn + 1 ||
(sn === lastSn && partIndex === this.lastPartIndex + 1) ||
cc === this.lastCc
)
) {
cea608Parser1.reset();
cea608Parser2.reset();
if (cea608Parser1 && cea608Parser2) {
if (
sn !== lastSn + 1 ||
(sn === lastSn && partIndex !== this.lastPartIndex + 1) ||
cc !== this.lastCc
) {
cea608Parser1.reset();
cea608Parser2.reset();
}
}
this.lastCc = cc as number;
this.lastSn = sn as number;
Expand Down

0 comments on commit 346a8b9

Please sign in to comment.