If we lose the current output for any reason (unplug, turns off, etc.) and then later it comes back, mpv should always recalculate all the scaling stuff. The optimization to avoid needless scaling calculations didn't consider this case and would always exit since the scaling is the same. So just check wl->current_output's existence as well. Fixes #15361.
Unified · Split
| @@ -1016,7 +1016,9 @@ static void surface_handle_preferred_buffer_scale(void *data, · 1015 unmodified lines | ||
| 1016 | 1016 | { |
| 1017 | 1017 | struct vo_wayland_state *wl = data; |
| 1018 | 1018 | |
| 1019 | − if (wl->fractional_scale_manager || wl->scaling == scale * WAYLAND_SCALE_FACTOR) | |
| 1019 | + if (wl->fractional_scale_manager || | |
| 1020 | + (wl->scaling == scale * WAYLAND_SCALE_FACTOR && | |
| 1021 | + wl->current_output && wl->current_output->has_surface)) | |
| 1020 | 1022 | return; |
| 1021 | 1023 | |
| 1022 | 1024 | wl->pending_scaling = scale * WAYLAND_SCALE_FACTOR; |
| @@ -1248,7 +1250,7 @@ static void preferred_scale(void *data, · 225 unmodified lines | ||
| 1248 | 1250 | uint32_t scale) |
| 1249 | 1251 | { |
| 1250 | 1252 | struct vo_wayland_state *wl = data; |
| 1251 | − if (wl->scaling == scale) | |
| 1253 | + if (wl->scaling == scale && wl->current_output && wl->current_output->has_surface) | |
| 1252 | 1254 | return; |
| 1253 | 1255 | |
| 1254 | 1256 | wl->pending_scaling = scale; |