Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/dash/dash_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2334,12 +2334,8 @@ shaka.dash.DashParser = class {
return element.attributes['schemeIdUri'] == expectedUri &&
element.attributes['value'] == expectedValue;
});
const codecs = context.representation.codecs;
// Detect the presence of Dolby Atmos audio content based on the codec and
// bandwidth. Bandwidth above 384 kbps is a good indicator of Atmos content.
const isAtmos = codecs.includes('ec-3') && context.bandwidth > 384000;
let spatialAudio = false;
if (hasJoc || isAtmos) {
if (hasJoc) {
spatialAudio = true;
}

Expand Down Expand Up @@ -2371,6 +2367,7 @@ shaka.dash.DashParser = class {

let hdr;
const profiles = context.profiles;
const codecs = context.representation.codecs;

const hevcHDR = 'http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10';
if (profiles.includes(hevcHDR) && (codecs.includes('hvc1.2.4.L153.B0') ||
Expand Down
22 changes: 0 additions & 22 deletions test/dash/dash_parser_manifest_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,28 +540,6 @@ describe('DashParser Manifest', () => {
expect(stream.spatialAudio).toBe(true);
});

it('Detects spatial audio by codec and bandwidth', async () => {
const source = [
'<MPD>',
' <Period duration="PT30M">',
' <AdaptationSet mimeType="audio/mp4" lang="\u2603">',
' <Representation bandwidth="768000" codecs="ec-3">',
' <BaseURL>http://example.com</BaseURL>',
' <SegmentTemplate media="2.mp4" duration="1" />',
' </Representation>',
' </AdaptationSet>',
' </Period>',
'</MPD>',
].join('\n');

fakeNetEngine.setResponseText('dummy://foo', source);

/** @type {shaka.extern.Manifest} */
const manifest = await parser.start('dummy://foo', playerInterface);
const stream = manifest.variants[0].audio;
expect(stream.spatialAudio).toBe(true);
});

it('correctly parses CEA-608 closed caption tags without channel numbers',
async () => {
const source = [
Expand Down