mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 13:32:16 +00:00
vo: don't pass VADRMPRIMESurfaceDescriptor by value
This commit is contained in:
parent
f2fdea9921
commit
d5222ece6b
@ -261,10 +261,10 @@ static int mapper_init(struct ra_hwdec_mapper *mapper)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void close_file_descriptors(VADRMPRIMESurfaceDescriptor desc)
|
||||
static void close_file_descriptors(const VADRMPRIMESurfaceDescriptor *desc)
|
||||
{
|
||||
for (int i = 0; i < desc.num_objects; i++)
|
||||
close(desc.objects[i].fd);
|
||||
for (int i = 0; i < desc->num_objects; i++)
|
||||
close(desc->objects[i].fd);
|
||||
}
|
||||
|
||||
static int mapper_map(struct ra_hwdec_mapper *mapper)
|
||||
@ -285,7 +285,7 @@ static int mapper_map(struct ra_hwdec_mapper *mapper)
|
||||
if (!CHECK_VA_STATUS_LEVEL(mapper, "vaExportSurfaceHandle()",
|
||||
p_owner->probing_formats ? MSGL_DEBUG : MSGL_ERR))
|
||||
{
|
||||
close_file_descriptors(desc);
|
||||
close_file_descriptors(&desc);
|
||||
goto err;
|
||||
}
|
||||
vaSyncSurface(display, va_surface_id(mapper->src));
|
||||
|
@ -137,10 +137,10 @@ static const struct wl_buffer_listener osd_buffer_listener = {
|
||||
};
|
||||
|
||||
#if HAVE_VAAPI
|
||||
static void close_file_descriptors(VADRMPRIMESurfaceDescriptor desc)
|
||||
static void close_file_descriptors(const VADRMPRIMESurfaceDescriptor *desc)
|
||||
{
|
||||
for (int i = 0; i < desc.num_objects; i++)
|
||||
close(desc.objects[i].fd);
|
||||
for (int i = 0; i < desc->num_objects; i++)
|
||||
close(desc->objects[i].fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -175,7 +175,7 @@ static bool vaapi_drm_format(struct vo *vo, struct mp_image *src)
|
||||
p->drm_modifier = desc.objects[0].drm_format_modifier;
|
||||
format = true;
|
||||
done:
|
||||
close_file_descriptors(desc);
|
||||
close_file_descriptors(&desc);
|
||||
#endif
|
||||
return format;
|
||||
}
|
||||
@ -216,7 +216,7 @@ static void vaapi_dmabuf_importer(struct buffer *buf, struct mp_image *src,
|
||||
}
|
||||
|
||||
done:
|
||||
close_file_descriptors(desc);
|
||||
close_file_descriptors(&desc);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user