Skip to content

Commit

Permalink
AMF: fix usage_from_view conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
psyke83 committed Mar 18, 2024
1 parent 03f36a8 commit 571820d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ namespace config {

template <class T>
std::optional<int>
usage_from_view(const std::string_view &rc) {
usage_from_view(const std::string_view &usage) {
#define _CONVERT_(x) \
if (rc == #x##sv) return (int) T::x
if (usage == #x##sv) return (int) T::x
_CONVERT_(high_quality);
_CONVERT_(transcoding);
_CONVERT_(webcam);
Expand Down Expand Up @@ -1006,9 +1006,9 @@ namespace config {
std::string usage;
string_f(vars, "amd_usage", usage);
if (!usage.empty()) {
video.amd.amd_usage_h264 = amd::usage_from_view<amd::usage_h264_e>(rc);
video.amd.amd_usage_hevc = amd::usage_from_view<amd::usage_hevc_e>(rc);
video.amd.amd_usage_av1 = amd::usage_from_view<amd::usage_av1_e>(rc);
video.amd.amd_usage_h264 = amd::usage_from_view<amd::usage_h264_e>(usage);
video.amd.amd_usage_hevc = amd::usage_from_view<amd::usage_hevc_e>(usage);
video.amd.amd_usage_av1 = amd::usage_from_view<amd::usage_av1_e>(usage);
}

bool_f(vars, "amd_preanalysis", (bool &) video.amd.amd_preanalysis);
Expand Down

0 comments on commit 571820d

Please sign in to comment.