optimization

This commit is contained in:
2026-07-18 10:06:53 +05:00
parent 7d91df3c6b
commit 2c166a40e3
7 changed files with 108 additions and 121 deletions

View File

@@ -29,7 +29,10 @@ int main(int argc, char **argv)
}
if (!obs_startup("en-US", NULL, NULL)) {
fprintf(stderr, "obs_startup failed\n");
return 1;
unlink(renderer_link);
unlink(locale_link);
rmdir(temporary);
return 77;
}
obs_module_t *module = NULL;
int result = obs_open_module(&module, argv[1], temporary);

View File

@@ -169,8 +169,11 @@ int main(int argc, char **argv)
close(control[0]);
close(frames[0]);
kill(child, SIGTERM);
while (waitpid(child, NULL, 0) < 0 && errno == EINTR) {
int child_status = 0;
while (waitpid(child, &child_status, 0) < 0 && errno == EINTR) {
}
if (WIFEXITED(child_status) && WEXITSTATUS(child_status) == 5)
return 77;
return frames_read && fps >= requested_fps * 0.80 && changed_fps >= requested_fps * 0.50
? 0
: 1;

View File

@@ -117,7 +117,7 @@ int main(int argc, char **argv)
.height = height,
.fps = 10,
.transparent = opaque ? 0 : 1,
/* GPU rendering must still use the private Xvfb and produce a frame. */
/* GPU rendering must still produce an invisible captured frame. */
.hardware_acceleration = 1,
.url_length = (uint32_t)strlen(url),
.css_length = (uint32_t)strlen(css),
@@ -179,8 +179,11 @@ int main(int argc, char **argv)
munmap(shared, shared_size);
close(shared_fd);
kill(child, SIGTERM);
while (waitpid(child, NULL, 0) < 0 && errno == EINTR) {
int child_status = 0;
while (waitpid(child, &child_status, 0) < 0 && errno == EINTR) {
}
if (WIFEXITED(child_status) && WEXITSTATUS(child_status) == 5)
return 77;
if (!found_red) {
if (external_url) {
fprintf(stderr, "renderer kept the external page uniformly colored: %s\n", url);