Straighten logic when probing for encoders
This commit is contained in:
19
src/main.cpp
19
src/main.cpp
@@ -323,7 +323,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (video::probe_encoders()) {
|
if (video::probe_encoders()) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
bool allow_probing = !video::allow_encoder_probing();
|
bool allow_probing = video::allow_encoder_probing();
|
||||||
bool probe_result = false;
|
bool probe_result = false;
|
||||||
// Create a temporary virtual display for encoder capability probing
|
// Create a temporary virtual display for encoder capability probing
|
||||||
if (proc::vDisplayDriverStatus == VDISPLAY::DRIVER_STATUS::OK) {
|
if (proc::vDisplayDriverStatus == VDISPLAY::DRIVER_STATUS::OK) {
|
||||||
@@ -349,21 +349,18 @@ int main(int argc, char *argv[]) {
|
|||||||
std::this_thread::sleep_for(500ms);
|
std::this_thread::sleep_for(500ms);
|
||||||
|
|
||||||
// Probe again anyways
|
// Probe again anyways
|
||||||
probe_result = video::probe_encoders();
|
if (video::probe_encoders()) {
|
||||||
|
if (allow_probing) {
|
||||||
|
BOOST_LOG(error) << "Video failed to find working encoder: allow probing but failed"sv;
|
||||||
|
} else {
|
||||||
|
BOOST_LOG(error) << "Video failed to find working encoder even after attempted with a virtual display"sv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VDISPLAY::removeVirtualDisplay(*probe_guid);
|
VDISPLAY::removeVirtualDisplay(*probe_guid);
|
||||||
} else if (!allow_probing) {
|
} else if (!allow_probing) {
|
||||||
BOOST_LOG(error) << "Video failed to find working encoder: probe failed and virtual display driver isn't initialized"sv;
|
BOOST_LOG(error) << "Video failed to find working encoder: probe failed and virtual display driver isn't initialized"sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When probing still fails somehow
|
|
||||||
if (allow_probing && probe_result) {
|
|
||||||
if (allow_probing) {
|
|
||||||
BOOST_LOG(error) << "Video failed to find working encoder: allow probing but failed"sv;
|
|
||||||
} else {
|
|
||||||
BOOST_LOG(error) << "Video failed to find working encoder even after attempted with a virtual display"sv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
BOOST_LOG(error) << "Video failed to find working encoder: probing failed."sv;
|
BOOST_LOG(error) << "Video failed to find working encoder: probing failed."sv;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user