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

Backported to v4.12.x
  • Loading branch information
avelad authored and joeyparrish committed Jan 6, 2025
1 parent 5252c8d commit 7a57011
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2763,12 +2763,23 @@ shaka.hls.HlsParser = class {
}
}
this.notifySegmentsForStreams_(streamInfos.map((s) => s.stream));
const liveWithNoProgramaDateTime =

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 ||
liveWithNoProgramaDateTime) {
liveWithNoProgramDateTime || vodWithOnlyAudioOrVideo) {
this.syncStreamsWithSequenceNumber_(
streamInfos, liveWithNoProgramaDateTime);
streamInfos, liveWithNoProgramDateTime);
} else {
this.syncStreamsWithProgramDateTime_(streamInfos);
if (this.config_.hls.ignoreManifestProgramDateTimeForTypes.length > 0) {
Expand Down

0 comments on commit 7a57011

Please sign in to comment.