Add TrueHD enabling option

This commit is contained in:
Dmitry Lyzo
2024-04-15 22:20:47 +03:00
committed by Dmitry Lyzo
parent ce15adba69
commit 275e18457e
5 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -562,7 +562,7 @@ export default function (options) {
videoAudioCodecs.push('pcm_s24le');
}
if (options.supportsTrueHd) {
if (appSettings.enableTrueHd() || options.supportsTrueHd) {
videoAudioCodecs.push('truehd');
}
+13
View File
@@ -145,6 +145,19 @@ class AppSettings {
return toBoolean(this.get('enableDts'), false);
}
/**
* Get or set 'Enable TrueHD' state.
* @param {boolean|undefined} val - Flag to enable 'Enable TrueHD' or undefined.
* @return {boolean} 'Enable TrueHD' state.
*/
enableTrueHd(val) {
if (val !== undefined) {
return this.set('enableTrueHd', val.toString());
}
return toBoolean(this.get('enableTrueHd'), false);
}
set(name, value, userId) {
const currentValue = this.get(name, userId);
localStorage.setItem(this.#getKey(name, userId), value);