Fix encoder probing when no display is active
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -318,7 +318,7 @@ int main(int argc, char *argv[]) {
|
||||
if (video::probe_encoders()) {
|
||||
#ifdef _WIN32
|
||||
// Create a temporary virtual display for encoder capability probing if no active display was found
|
||||
if (!video::allow_encoder_probing() && proc::vDisplayDriverStatus == VDISPLAY::DRIVER_STATUS::OK) {
|
||||
if (!video::allow_encoder_probing()) {
|
||||
std::string probe_uuid_str = PROBE_DISPLAY_UUID;
|
||||
auto probe_uuid = uuid_util::uuid_t::parse(probe_uuid_str);
|
||||
auto* probe_guid = (GUID*)(void*)&probe_uuid;
|
||||
@@ -340,15 +340,19 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
// Probe again anyways
|
||||
if (video::probe_encoders()) {
|
||||
BOOST_LOG(error) << "Video failed to find working encoder"sv;
|
||||
BOOST_LOG(error) << "Video failed to find working encoder even after attempted with a virtual display"sv;
|
||||
}
|
||||
|
||||
VDISPLAY::removeVirtualDisplay(*probe_guid);
|
||||
} else {
|
||||
BOOST_LOG(error) << "Video failed to find working encoder"sv;
|
||||
if (proc::vDisplayDriverStatus == VDISPLAY::DRIVER_STATUS::OK) {
|
||||
BOOST_LOG(error) << "Video failed to find working encoder: allow probing but failed"sv;
|
||||
} else {
|
||||
BOOST_LOG(error) << "Video failed to find working encoder: probe failed and virtual display driver isn't initialized"sv;
|
||||
}
|
||||
}
|
||||
#else
|
||||
BOOST_LOG(error) << "Video failed to find working encoder"sv;
|
||||
BOOST_LOG(error) << "Video failed to find working encoder: probing failed."sv;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user