diff options
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo.c | 5 | ||||
-rw-r--r-- | video/out/vo.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index a069c442df..0dc60a558d 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -406,6 +406,9 @@ int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags) vo->dwidth = d_width; vo->dheight = d_height; + talloc_free(vo->params); + vo->params = NULL; + struct mp_image_params p2 = *params; int ret; @@ -419,6 +422,8 @@ int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags) } vo->config_ok = (ret >= 0); vo->config_count += vo->config_ok; + if (vo->config_ok) + vo->params = talloc_memdup(vo, &p2, sizeof(p2)); if (vo->registered_fd == -1 && vo->event_fd != -1 && vo->config_ok) { mp_input_add_key_fd(vo->input_ctx, vo->event_fd, 1, event_fd_callback, NULL, vo); diff --git a/video/out/vo.h b/video/out/vo.h index 50e83d2809..3b6adddb0c 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -238,6 +238,7 @@ struct vo { struct mp_log *log; // Using e.g. "[vo/vdpau]" as prefix int config_ok; // Last config call was successful? int config_count; // Total number of successful config calls + struct mp_image_params *params; // Configured parameters (as in vo_reconfig) bool probing; |