Skip to content

Commit

Permalink
fix(HLS): Do not use EXT-X-PROGRAM-DATE-TIME on vod when there is onl…
Browse files Browse the repository at this point in the history
…y video or audio (#7802)

Fixes #7774
  • Loading branch information
avelad authored Dec 24, 2024
1 parent fd78ec4 commit fe94b6b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2792,10 +2792,21 @@ shaka.hls.HlsParser = class {
}
}
this.notifySegmentsForStreams_(streamInfos.map((s) => s.stream));

const activeStreamInfos = Array.from(this.uriToStreamInfosMap_.values())
.filter((s) => s.stream.segmentIndex);
const ContentType = shaka.util.ManifestParserUtils.ContentType;
const hasAudio =
activeStreamInfos.some((s) => s.stream.type == ContentType.AUDIO);
const hasVideo =
activeStreamInfos.some((s) => s.stream.type == ContentType.VIDEO);

const liveWithNoProgramDateTime =
this.isLive_() && !this.usesProgramDateTime_;
const vodWithOnlyAudioOrVideo = !this.isLive_() &&
this.usesProgramDateTime_ && !(hasAudio && hasVideo);
if (this.config_.hls.ignoreManifestProgramDateTime ||
liveWithNoProgramDateTime) {
liveWithNoProgramDateTime || vodWithOnlyAudioOrVideo) {
this.syncStreamsWithSequenceNumber_(
streamInfos, liveWithNoProgramDateTime);
} else {
Expand Down

0 comments on commit fe94b6b

Please sign in to comment.