mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-02-15 02:44:39 +01:00
do-not-fail-if-icon-fails
This commit is contained in:
@@ -461,28 +461,25 @@ sc_screen_init(struct sc_screen *screen,
|
||||
if (!SDL_SetWindowIcon(screen->window, icon)) {
|
||||
LOGW("Could not set window icon: %s", SDL_GetError());
|
||||
}
|
||||
} else if (params->video) {
|
||||
// just a warning
|
||||
LOGW("Could not load icon");
|
||||
} else {
|
||||
// without video, the icon is used as window content, it must be present
|
||||
LOGE("Could not load icon");
|
||||
goto error_destroy_texture;
|
||||
}
|
||||
|
||||
if (!params->video) {
|
||||
assert(icon);
|
||||
screen->content_size.width = icon->w;
|
||||
screen->content_size.height = icon->h;
|
||||
ok = sc_texture_set_from_surface(&screen->tex, icon);
|
||||
if (!ok) {
|
||||
if (!params->video) {
|
||||
screen->content_size.width = icon->w;
|
||||
screen->content_size.height = icon->h;
|
||||
ok = sc_texture_set_from_surface(&screen->tex, icon);
|
||||
sc_icon_destroy(icon);
|
||||
goto error_destroy_texture;
|
||||
if (!ok) {
|
||||
LOGE("Could not set icon: %s", SDL_GetError());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// not fatal
|
||||
LOGE("Could not load icon");
|
||||
|
||||
if (icon) {
|
||||
sc_icon_destroy(icon);
|
||||
if (!params->video) {
|
||||
// Make sure the content size is initialized
|
||||
screen->content_size.width = 256;
|
||||
screen->content_size.height = 256;
|
||||
}
|
||||
}
|
||||
|
||||
screen->frame = av_frame_alloc();
|
||||
|
||||
Reference in New Issue
Block a user