Skip to content

Commit

Permalink
fix(HLS): Fix audio detection when there is no audio data but it appe…
Browse files Browse the repository at this point in the history
…ars in PMT (#7838)
  • Loading branch information
avelad authored Jan 7, 2025
1 parent 5b13332 commit 34b69fa
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions lib/media/segment_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,34 @@ shaka.media.SegmentUtils = class {
switch (tsCodecs.audio) {
case 'aac':
case 'aac-loas':
codecs.push('mp4a.40.2');
hasAudio = true;
if (tsParser.getAudioData().length) {
codecs.push('mp4a.40.2');
hasAudio = true;
}
break;
case 'mp3':
codecs.push('mp4a.40.34');
hasAudio = true;
if (tsParser.getAudioData().length) {
codecs.push('mp4a.40.34');
hasAudio = true;
}
break;
case 'ac3':
codecs.push('ac-3');
hasAudio = true;
if (tsParser.getAudioData().length) {
codecs.push('ac-3');
hasAudio = true;
}
break;
case 'ec3':
codecs.push('ec-3');
hasAudio = true;
if (tsParser.getAudioData().length) {
codecs.push('ec-3');
hasAudio = true;
}
break;
case 'opus':
codecs.push('opus');
hasAudio = true;
if (tsParser.getAudioData().length) {
codecs.push('opus');
hasAudio = true;
}
break;
}
}
Expand Down

0 comments on commit 34b69fa

Please sign in to comment.