Skip to content

Commit

Permalink
fix: AC-3 audio codec support on Tizen (#6166)
Browse files Browse the repository at this point in the history
Fixes #6160
  • Loading branch information
Boubalou authored and avelad committed Jan 30, 2024
1 parent fb1214d commit 77121fa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Lucas Gabriel Sánchez <[email protected]>
Martin Stark <[email protected]>
Matthias Van Parijs <[email protected]>
Mattias Wadman <[email protected]>
Mirego <*@mirego.com>
Mohamed Rashid <[email protected]>
Morten Hansen <[email protected]>
Nick Desaulniers <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Loïc Raux <[email protected]>
Lucas Gabriel Sánchez <[email protected]>
Martin Stark <[email protected]>
Matias Russitto <[email protected]>
Mathieu Côté <[email protected]>
Matthias Van Parijs <[email protected]>
Mattias Wadman <[email protected]>
Michelle Zhuo <[email protected]>
Expand Down
15 changes: 14 additions & 1 deletion lib/polyfill/media_capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,23 @@ shaka.polyfill.MediaCapabilities = class {
const videoCapabilities = [];

if (mediaCapkeySystemConfig.audio) {
const capability = {
let capability = {
robustness: mediaCapkeySystemConfig.audio.robustness || '',
contentType: mediaDecodingConfig.audio.contentType,
};

// Some Tizen devices seem to misreport AC-3 support, but correctly
// report EC-3 support. So query EC-3 as a fallback for AC-3.
// See https://github.com/shaka-project/shaka-player/issues/2989 for
// details.
if (shaka.util.Platform.isTizen() &&
mediaDecodingConfig.audio.contentType.includes('codecs="ac-3"')) {
capability = {
robustness: capability.robustness,
contentType: 'audio/mp4; codecs="ec-3"',
};
}

audioCapabilities.push(capability);
}

Expand Down
10 changes: 1 addition & 9 deletions lib/util/stream_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,15 +848,7 @@ shaka.util.StreamUtils = class {
return 'opus';
}

// Some Tizen devices seem to misreport AC-3 support, but correctly
// report EC-3 support. So query EC-3 as a fallback for AC-3.
// See https://github.com/shaka-project/shaka-player/issues/2989 for
// details.
if (shaka.util.Platform.isTizen()) {
return codecs.toLowerCase() == 'ac-3' ? 'ec-3' : codecs;
} else {
return codecs;
}
return codecs;
}


Expand Down

0 comments on commit 77121fa

Please sign in to comment.