Skip to content

Commit

Permalink
fix(HLS): Fix filtering video/audio streams without bandwidth (#7008)
Browse files Browse the repository at this point in the history
Fixes #7007
  • Loading branch information
avelad committed Jul 10, 2024
1 parent 368860e commit 8a078d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/util/stream_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ shaka.util.StreamUtils = class {
const currentCodec =
MimeUtils.getNormalizedCodec(stream.codecs);
if (previousCodec == currentCodec) {
if (stream.bandwidth > previousStream.bandwidth) {
if (!stream.bandwidth || !previousStream.bandwidth ||
stream.bandwidth > previousStream.bandwidth) {
validAudioStreams.push(stream);
validAudioIds.push(stream.id);
}
Expand Down Expand Up @@ -162,7 +163,8 @@ shaka.util.StreamUtils = class {
const currentCodec =
MimeUtils.getNormalizedCodec(stream.codecs);
if (previousCodec == currentCodec) {
if (stream.bandwidth > previousStream.bandwidth) {
if (!stream.bandwidth || !previousStream.bandwidth ||
stream.bandwidth > previousStream.bandwidth) {
validVideoStreams.push(stream);
validVideoIds.push(stream.id);
}
Expand Down

0 comments on commit 8a078d1

Please sign in to comment.