Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogTheFrog committed Jan 19, 2024
1 parent f0ddfaa commit e5efac2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/platform/display_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ namespace platf {
}

if (boost::get<boost::blank>(&recovery_config->data)) {
// Config was "applied" succesfully, but no changes were needed so nothing to recover from.
// Config was "applied" successfully, but no changes were needed so nothing to recover from.
recovery_config = boost::none;
return true;
}
Expand Down Expand Up @@ -542,17 +542,17 @@ namespace platf {
if (boost::regex_match(trimmed_string, match, resolution_regex)) {
try {
if (match[2].matched) {
// We have a decimal point and will have to split it into numberator and denumerator.
// We have a decimal point and will have to split it into numerator and denominator.
// For example:
// 59.995:
// numerator = 59995
// denumerator = 1000
// denominator = 1000

const std::string numerator_str { match[1].str() + match[2].str() };
const auto numerator { static_cast<unsigned int>(std::stol(numerator_str)) };
const auto denumerator { static_cast<unsigned int>(std::pow(10, std::distance(match[2].first, match[2].second))) };
const auto denominator { static_cast<unsigned int>(std::pow(10, std::distance(match[2].first, match[2].second))) };

parsed_config.refresh_rate = refresh_rate_t { numerator, denumerator };
parsed_config.refresh_rate = refresh_rate_t { numerator, denominator };
}
else {
parsed_config.refresh_rate = refresh_rate_t { static_cast<unsigned int>(std::stol(match[1])), 1 };
Expand Down
6 changes: 3 additions & 3 deletions src/platform/display_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ namespace platf {
set_display_modes(const device_display_mode_map_t &modes);

/*!
* Check whether the specified device is pripary.
* Check whether the specified device is primary.
*/
bool
is_primary_device(const std::string &device_id);
Expand Down Expand Up @@ -300,7 +300,7 @@ namespace platf {
/*!
* Parses the configuration and session parameters.
*
* @returns config that is ready to be used or empty optional if some error has occured.
* @returns config that is ready to be used or empty optional if some error has occurred.
*/
boost::optional<parsed_config_t>
parse_config(const config::video_t &config, const rtsp_stream::launch_session_t &session);
Expand All @@ -311,7 +311,7 @@ namespace platf {
* @note if a recovery config is returned, it should contain a valid data type
* for the platform. If it contains blank, it means the configuration
* did not need to be applied - no recovery to be done afterwards and
* we can still procceed.
* we can still proceed.
*/
boost::optional<recovery_config_t>
apply_config(const parsed_config_t &config);
Expand Down
20 changes: 10 additions & 10 deletions src/platform/windows/display_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ namespace platf {
// only the whole group needs to be active

if (primary_device_requested) {
// Condition !duplicated_devices.empty() should be already verified ouside the function
// Condition !duplicated_devices.empty() should be already verified outside the function

if (current_topology.size() > 1) {
// There are other topology groups other than the primary devices
Expand Down Expand Up @@ -459,23 +459,23 @@ namespace platf {
const auto current_topology { utils::parse_topology_from_paths(display_data->paths) };
for (const auto &topology : current_topology) {
const auto &device_id { topology.first };
const auto &tolopogy_info { topology.second };
const auto &topology_info { topology.second };

if (tolopogy_info.active_display) {
const auto &path { display_data->paths.at(tolopogy_info.active_display->path_index) };
if (topology_info.active_display) {
const auto &path { display_data->paths.at(topology_info.active_display->path_index) };
const auto mode { utils::get_source_mode(utils::get_source_index(path, display_data->modes), display_data->modes) };

available_devices[device_id] = device_info_t {
utils::get_display_name(path),
tolopogy_info.friendly_name,
topology_info.friendly_name,
mode && utils::is_primary(*mode) ? device_state_e::PRIMARY : device_state_e::ACTIVE,
utils::get_hdr_state(path)
};
}
else {
available_devices[device_id] = device_info_t {
std::string {}, // Inactive device can have multiple display names, so it's just meaningless
tolopogy_info.friendly_name,
topology_info.friendly_name,
device_state_e::INACTIVE,
hdr_state_e::UNKNOWN
};
Expand Down Expand Up @@ -558,19 +558,19 @@ namespace platf {
const auto current_modes { get_modes(device_ids, NO_DUPLICATES) };
if (!original_modes.empty()) {
bool all_modes_match { true };
for (const auto &[device_id, requeted_mode] : modes) {
for (const auto &[device_id, requested_mode] : modes) {
auto mode_it { current_modes.find(device_id) };
if (mode_it == std::end(current_modes)) {
// I mean this race condition is technically possible...
all_modes_match = false;
break;
}

if (!fuzzy_compare_modes(mode_it->second, requeted_mode)) {
if (!fuzzy_compare_modes(mode_it->second, requested_mode)) {
// We have a problem when using SetDisplayConfig with SDC_ALLOW_CHANGES (which we need to use as otherwise we to be very precise)
// where it decides to use our new mode merely as a suggestion. This is good, since we don't have to be very precise with
// refresh rate, but also bad since it can just ignore our specified mode.
// Thus, we need to revert changes if they deviate too much for the requested davice and any "duplicated" devices.
// Thus, we need to revert changes if they deviate too much for the requested device and any "duplicated" devices.

all_modes_match = false;
break;
Expand Down Expand Up @@ -1049,7 +1049,7 @@ namespace platf {
}

if (recovery->initial_topology.empty()) {
// The config is currupted or smt...
// The config is corrupted or smt...
BOOST_LOG(error) << "recovery config does not have initial topology!";
return;
}
Expand Down

0 comments on commit e5efac2

Please sign in to comment.