Skip to content

Commit

Permalink
fix: Fix handling of CC when switching between codecs (#5160)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and joeyparrish committed Apr 26, 2023
1 parent 2ee97e2 commit 3ea3fb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/media/media_source_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ shaka.media.MediaSourceEngine = class {
// For HLS CEA-608/708 CLOSED-CAPTIONS, text data is embedded in
// the video stream, so textEngine may not have been initialized.
if (!this.textEngine_) {
this.reinitText('text/vtt');
this.reinitText(shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE);
}

if (transmuxedData.metadata) {
Expand All @@ -545,7 +545,7 @@ shaka.media.MediaSourceEngine = class {
contentType, () => this.append_(contentType, transmuxedSegment));
} else if (hasClosedCaptions) {
if (!this.textEngine_) {
this.reinitText('text/vtt');
this.reinitText(shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE);
}
// If it is the init segment for closed captions, initialize the closed
// caption parser.
Expand Down
1 change: 1 addition & 0 deletions lib/text/text_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ shaka.text.TextEngine = class {
// into TextEngine and TextDisplayer.
if (mimeType == shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE ||
mimeType == shaka.util.MimeUtils.CEA708_CLOSED_CAPTION_MIMETYPE) {
this.parser_ = null;
return;
}

Expand Down

0 comments on commit 3ea3fb4

Please sign in to comment.