Simplify screen initialization

Use a single function to initialize the screen instance.
This commit is contained in:
Romain Vimont
2021-02-25 22:06:33 +01:00
parent 597c54f049
commit cc48b24324
3 changed files with 22 additions and 31 deletions

View File

@@ -382,8 +382,6 @@ scrcpy(const struct scrcpy_options *options) {
const char *window_title =
options->window_title ? options->window_title : device_name;
screen_init(&screen, &video_buffer, &fps_counter);
struct screen_params screen_params = {
.window_title = window_title,
.frame_size = frame_size,
@@ -397,7 +395,8 @@ scrcpy(const struct scrcpy_options *options) {
.mipmaps = options->mipmaps,
};
if (!screen_init_rendering(&screen, &screen_params)) {
if (!screen_init(&screen, &video_buffer, &fps_counter,
&screen_params)) {
goto end;
}