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
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,15 @@ AudioInputChoiceList input_choices(std::vector<AudioFormat> supported, const Aud
return x.channelConfig() < y.channelConfig();
});

// 4. The misreporting capture-card case: 1ch x 96000, which is
// physically two 48 kHz channels interleaved.
// Offer the reinterpretations in addition to the native choice.
for (const AudioFormat& format : deduped){
ret.choices.emplace_back(format);
}

// 4. The misreporting capture-card case: the only supported format is
// 1ch x 96000, which is physically two 48 kHz channels interleaved.
// Offer the reinterpretations in addition to the native choice.
if (ret.choices.size() == 1){
const QAudioFormat& only = ret.choices[0].format().native_format();
const QAudioFormat& only = format.native_format();
if (only.channelCount() == 1 && only.sampleRate() == 96000){
ret.choices.emplace_back(reinterpreted_96k_choice(ret.choices[0].format(), false));
ret.choices.emplace_back(reinterpreted_96k_choice(ret.choices[0].format(), true));
ret.choices.emplace_back(reinterpreted_96k_choice(format, false));
ret.choices.emplace_back(reinterpreted_96k_choice(format, true));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,9 @@ class InputChoicesCardQuirkTest : public UnitTest{
AudioInputChoiceList mixed = input_choices(
{card, make_format(48000, 2, QAudioFormat::ChannelConfig::ChannelConfigStereo)}, card
);
if (mixed.choices.size() != 2
|| mixed.choices[0].is_reinterpreted() || mixed.choices[1].is_reinterpreted()){
return "A device with other formats should not get reinterpretation entries.";
}
if (mixed.choices[0].display_name() != "2 x 48,000 Hz (Stereo)"
|| mixed.choices[1].display_name() != "1 x 96,000 Hz (Mono)"){
if (mixed.choices[0].display_name() != "2 x 48,000 Hz (Stereo)" ||
mixed.choices[1].display_name() != "1 x 96,000 Hz (Mono)"
){
return "Mixed device should list the native entries sorted by channel count desc, then sample rate desc.";
}

Expand Down
Loading