cellAudioOut: fix AC3/DTS mixup

This commit is contained in:
Megamouse 2022-06-01 19:49:26 +02:00
parent d6065e8814
commit 350d3ad386
4 changed files with 17 additions and 17 deletions

View File

@ -47,14 +47,14 @@ audio_out_configuration::audio_out_configuration()
const bool supports_lpcm_2 = (sound_format & (1 << 0)); // Linear PCM 2 Ch.
const bool supports_lpcm_5_1 = (sound_format & (1 << 2)); // Linear PCM 5.1 Ch.
const bool supports_lpcm_7_1 = (sound_format & (1 << 4)); // Linear PCM 7.1 Ch.
const bool supports_dts = (sound_format & (1 << 8)); // DTS 5.1 Ch.
const bool supports_ac3 = (sound_format & (1 << 9)); // Dolby Digital 5.1 Ch.
const bool supports_ac3 = (sound_format & (1 << 8)); // Dolby Digital 5.1 Ch.
const bool supports_dts = (sound_format & (1 << 9)); // DTS 5.1 Ch.
if (supports_lpcm_2) cellSysutil.notice("cellAudioOut: found support for Linear PCM 2 Ch.");
if (supports_lpcm_5_1) cellSysutil.notice("cellAudioOut: found support for Linear PCM 5.1 Ch.");
if (supports_lpcm_7_1) cellSysutil.notice("cellAudioOut: found support for Linear PCM 7.1 Ch.");
if (supports_dts) cellSysutil.notice("cellAudioOut: found support for DTS 5.1 Ch.");
if (supports_ac3) cellSysutil.notice("cellAudioOut: found support for Dolby Digital 5.1 Ch.");
if (supports_dts) cellSysutil.notice("cellAudioOut: found support for DTS 5.1 Ch.");
const auto add_sound_mode = [](std::vector<CellAudioOutSoundMode>& sound_modes, u8 type, u8 channel, u8 fs, u32 layout)
{
@ -102,16 +102,16 @@ audio_out_configuration::audio_out_configuration()
add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_LPCM, CELL_AUDIO_OUT_CHNUM_8, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy);
}
if (supports_dts) // DTS 5.1 Ch.
{
add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr);
}
if (supports_ac3) // Dolby Digital 5.1 Ch.
{
add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_AC3, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr);
}
if (supports_dts) // DTS 5.1 Ch.
{
add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr);
}
break;
}
case audio_format::lpcm_2_48khz: // Linear PCM 2 Ch. 48 kHz
@ -131,18 +131,18 @@ audio_out_configuration::audio_out_configuration()
add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_LPCM, CELL_AUDIO_OUT_CHNUM_8, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy);
break;
}
case audio_format::dts: // DTS 5.1 Ch.
{
add_fallback = !supports_dts;
add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr);
break;
}
case audio_format::ac3: // Dolby Digital 5.1 Ch.
{
add_fallback = !supports_ac3;
add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_AC3, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr);
break;
}
case audio_format::dts: // DTS 5.1 Ch.
{
add_fallback = !supports_dts;
add_sound_mode_to_both_outputs(CELL_AUDIO_OUT_CODING_TYPE_DTS, CELL_AUDIO_OUT_CHNUM_6, CELL_AUDIO_OUT_FS_48KHZ, CELL_AUDIO_OUT_SPEAKER_LAYOUT_6CH_LREClr);
break;
}
}
// Fallback to default sound mode if none was found

View File

@ -542,8 +542,8 @@ void fmt_class_string<audio_format>::format(std::string& out, u64 arg)
case audio_format::lpcm_2_48khz: return "Linear PCM 2 Ch. 48 kHz";
case audio_format::lpcm_5_1_48khz: return "Linear PCM 5.1 Ch. 48 kHz";
case audio_format::lpcm_7_1_48khz: return "Linear PCM 7.1 Ch. 48 kHz";
case audio_format::dts: return "DTS 5.1 Ch.";
case audio_format::ac3: return "Dolby Digital 5.1 Ch.";
case audio_format::dts: return "DTS 5.1 Ch.";
}
return unknown;

View File

@ -81,8 +81,8 @@ enum class audio_format
lpcm_2_48khz,
lpcm_5_1_48khz,
lpcm_7_1_48khz,
dts,
ac3,
dts,
automatic,
};

View File

@ -1147,8 +1147,8 @@ QString emu_settings::GetLocalizedSetting(const QString& original, emu_settings_
case audio_format::lpcm_2_48khz: return tr("Linear PCM 2 Ch. 48 kHz", "Audio format");
case audio_format::lpcm_5_1_48khz: return tr("Linear PCM 5.1 Ch. 48 kHz", "Audio format");
case audio_format::lpcm_7_1_48khz: return tr("Linear PCM 7.1 Ch. 48 kHz", "Audio format");
case audio_format::dts: return tr("DTS 5.1 Ch.", "Audio format");
case audio_format::ac3: return tr("Dolby Digital 5.1 Ch.", "Audio format");
case audio_format::dts: return tr("DTS 5.1 Ch.", "Audio format");
}
break;
case emu_settings_type::LicenseArea: