summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-03-05 17:53:12 +0100
committerJan Ekström <jeebjp@gmail.com>2023-03-05 22:36:56 +0200
commit2a7122ac41c939fea05a361a3838ca2773de4379 (patch)
tree48ee35fcdb4a071c2b3522408d3ac1cff84b49a3 /video
parentc0ca5f1a37a8e779337503d90e7ed2f0257d61f1 (diff)
downloadmpv-2a7122ac41c939fea05a361a3838ca2773de4379.tar.bz2
mpv-2a7122ac41c939fea05a361a3838ca2773de4379.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/mp_image.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index 5753f144d9..7d92d3c567 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -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)