diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo.c | 14 | ||||
-rw-r--r-- | video/out/vo.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index 08a0a9f88b..319e2c07fb 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -614,6 +614,10 @@ 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; @@ -1480,3 +1484,13 @@ struct mp_image_params vo_get_current_params(struct vo *vo) mp_mutex_unlock(&vo->params_mutex); return p; } + +struct mp_image_params vo_get_target_params(struct vo *vo) +{ + struct mp_image_params p = {0}; + mp_mutex_lock(&vo->params_mutex); + if (vo->target_params) + p = *vo->target_params; + mp_mutex_unlock(&vo->params_mutex); + return p; +} diff --git a/video/out/vo.h b/video/out/vo.h index 3879d024e7..3deee0d3a7 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -481,6 +481,7 @@ struct vo { // 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 // --- The following fields can be accessed only by the VO thread, or from // anywhere _if_ the VO thread is suspended (use vo->dispatch). @@ -554,5 +555,6 @@ void vo_get_src_dst_rects(struct vo *vo, struct mp_rect *out_src, struct vo_frame *vo_frame_ref(struct vo_frame *frame); struct mp_image_params vo_get_current_params(struct vo *vo); +struct mp_image_params vo_get_target_params(struct vo *vo); #endif /* MPLAYER_VIDEO_OUT_H */ |