diff --git a/video/out/vo.c b/video/out/vo.c index 319e2c07fb..db29690950 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -614,10 +614,6 @@ static void run_reconfig(void *p) mp_mutex_unlock(&vo->params_mutex); } - mp_mutex_lock(&vo->params_mutex); - talloc_free(vo->target_params); - vo->target_params = NULL; - mp_mutex_unlock(&vo->params_mutex); mp_mutex_lock(&in->lock); talloc_free(in->current_frame); in->current_frame = NULL; diff --git a/video/out/vo.h b/video/out/vo.h index 3deee0d3a7..eb92d4fc5b 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -480,8 +480,10 @@ struct vo { // which are still safe to read in the play loop, but for correctness // generic getter is protected by params_mutex. mp_mutex params_mutex; - struct mp_image_params *params; // Configured parameters (changed in vo_reconfig) - struct mp_image_params *target_params; // Target display parameters + // Configured parameters (changed in vo_reconfig) + struct mp_image_params *params; + // Target display parameters (VO is responsible for re-/setting) + struct mp_image_params *target_params; // --- The following fields can be accessed only by the VO thread, or from // anywhere _if_ the VO thread is suspended (use vo->dispatch). diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 8b6dfa2776..17fdb1a98a 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1221,6 +1221,7 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) return -1; resize(vo); + TA_FREEP(&vo->target_params); return 0; }