diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index dce804818b90e..4687d3d39d905 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -594,7 +594,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src struct pl_frame *frame) { struct mp_image *mpi = src->frame_data; - const struct mp_image_params *par = &mpi->params; + struct mp_image_params par = mpi->params; struct frame_priv *fp = mpi->priv; struct vo *vo = fp->vo; struct priv *p = vo->priv; @@ -610,23 +610,25 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src return false; } - par = &p->hwdec_mapper->dst_params; + par = p->hwdec_mapper->dst_params; } + mp_image_params_guess_csp(&par); + *frame = (struct pl_frame) { - .color = par->color, - .repr = par->repr, + .color = par.color, + .repr = par.repr, .profile = { .data = mpi->icc_profile ? mpi->icc_profile->data : NULL, .len = mpi->icc_profile ? mpi->icc_profile->size : 0, }, - .rotation = par->rotate / 90, + .rotation = par.rotate / 90, .user_data = mpi, }; if (fp->hwdec) { - struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(par->imgfmt); + struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(par.imgfmt); frame->acquire = hwdec_acquire; frame->release = hwdec_release; frame->num_planes = desc.num_planes; @@ -686,7 +688,7 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src } // Update chroma location, must be done after initializing planes - pl_frame_set_chroma_location(frame, par->chroma_location); + pl_frame_set_chroma_location(frame, par.chroma_location); if (mpi->film_grain) pl_film_grain_from_av(&frame->film_grain, (AVFilmGrainParams *) mpi->film_grain->data);