mp_image: copy side data in mp_image_copy_attributes

This fixes HDR10 and HDR10+ metadata usage in vo_gpu_next when hwdec
copy variant is used.
This commit is contained in:
Kacper Michajłow 2023-03-05 17:53:12 +01:00 committed by Jan Ekström
parent c0ca5f1a37
commit 2a7122ac41
1 changed files with 12 additions and 0 deletions

View File

@ -549,6 +549,18 @@ void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src)
assign_bufref(&dst->dovi_buf, src->dovi_buf);
assign_bufref(&dst->film_grain, src->film_grain);
assign_bufref(&dst->a53_cc, src->a53_cc);
for (int n = 0; n < dst->num_ff_side_data; n++)
av_buffer_unref(&dst->ff_side_data[n].buf);
MP_RESIZE_ARRAY(NULL, dst->ff_side_data, src->num_ff_side_data);
dst->num_ff_side_data = src->num_ff_side_data;
for (int n = 0; n < dst->num_ff_side_data; n++) {
dst->ff_side_data[n].type = src->ff_side_data[n].type;
dst->ff_side_data[n].buf = av_buffer_ref(src->ff_side_data[n].buf);
MP_HANDLE_OOM(dst->ff_side_data[n].buf);
}
}
// Crop the given image to (x0, y0)-(x1, y1) (bottom/right border exclusive)