We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0dc42a4 + c62771c commit 12e12bcCopy full SHA for 12e12bc
src/usb_cam_node.cpp
@@ -124,8 +124,15 @@ void UsbCamNode::service_capture(
124
std::string resolve_device_path(const std::string & path)
125
{
126
if (std::filesystem::is_symlink(path)) {
127
- // For some reason read_symlink only returns videox
128
- return "/dev/" + std::string(std::filesystem::read_symlink(path));
+ std::filesystem::path target_path = std::filesystem::read_symlink(path);
+
129
+ // if the target path is relative, resolve it
130
+ if (target_path.is_relative()) {
131
+ target_path = std::filesystem::absolute(path).parent_path() / target_path;
132
+ target_path = std::filesystem::canonical(target_path);
133
+ }
134
135
+ return target_path.string();
136
}
137
return path;
138
0 commit comments