Skip to content

Commit 7037ff4

Browse files
llyyrkasper93
authored andcommitted
wayland: only unset image description if we couldn't set a new one
set_image_description replaces the old image description, so we don't need to call unset_image_description unconditionally. Only call it if we couldn't set an image description. This helps with the lack of synchronization between VO pageflips and wayland protocol events mentioned in the previous commit.
1 parent f0883cd commit 7037ff4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

video/out/wayland_common.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,7 @@ static void image_description_failed(void *data, struct wp_image_description_v1
21082108
{
21092109
struct vo_wayland_state *wl = data;
21102110
MP_VERBOSE(wl, "Image description failed: %d, %s\n", cause, msg);
2111+
wp_color_management_surface_v1_unset_image_description(wl->color_surface);
21112112
wp_image_description_v1_destroy(image_description);
21122113
}
21132114

@@ -3450,17 +3451,17 @@ static void set_color_management(struct vo_wayland_state *wl)
34503451
if (!wl->color_surface)
34513452
return;
34523453

3453-
wp_color_management_surface_v1_unset_image_description(wl->color_surface);
3454-
34553454
struct pl_color_space color = wl->target_params.color;
34563455
int primaries = wl->primaries_map[color.primaries];
34573456
int transfer = wl->transfer_map[color.transfer];
34583457
if (!primaries)
34593458
MP_VERBOSE(wl, "Compositor does not support color primary: %s\n", m_opt_choice_str(pl_csp_prim_names, color.primaries));
34603459
if (!transfer)
34613460
MP_VERBOSE(wl, "Compositor does not support transfer function: %s\n", m_opt_choice_str(pl_csp_trc_names, color.transfer));
3462-
if (!primaries || !transfer)
3461+
if (!primaries || !transfer) {
3462+
wp_color_management_surface_v1_unset_image_description(wl->color_surface);
34633463
return;
3464+
}
34643465

34653466
struct wp_image_description_creator_params_v1 *image_creator_params =
34663467
wp_color_manager_v1_create_parametric_creator(wl->color_manager);

0 commit comments

Comments
 (0)