diff options
author | wm4 <wm4@nowhere> | 2014-01-24 21:22:25 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-24 21:22:25 +0100 |
commit | 2e66f4b89b525f15a709df95ac86cccbcab6bd49 (patch) | |
tree | 8c08885e202b4fa25f4de1652c8813014290617d /video/out/vo.c | |
parent | 7a6227a18476aee655df5dc76d27c281cc3590c2 (diff) | |
download | mpv-2e66f4b89b525f15a709df95ac86cccbcab6bd49.tar.bz2 mpv-2e66f4b89b525f15a709df95ac86cccbcab6bd49.tar.xz |
video/out: do remaining config to reconfig replacements
The main difference between the old and new callbacks is that the old
callbacks required passing the window size, which is and always was very
inconvenient and confusing, since the window size is already in
vo->dwidth and vo->dheight.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r-- | video/out/vo.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index 334cc9958f..66c148135d 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -431,21 +431,11 @@ int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags) vo->dwidth = d_width; vo->dheight = d_height; - struct mp_image_params p2 = *params; - talloc_free(vo->params); - vo->params = talloc_memdup(vo, &p2, sizeof(p2));; + vo->params = talloc_memdup(vo, params, sizeof(*params)); - int ret; - if (vo->driver->reconfig) { - ret = vo->driver->reconfig(vo, &p2, flags); - } else { - // Old config() takes window size, while reconfig() takes aspect (!) - ret = vo->driver->config(vo, p2.w, p2.h, d_width, d_height, flags, - p2.imgfmt); - ret = ret ? -1 : 0; - } - vo->config_ok = (ret >= 0); + int ret = vo->driver->reconfig(vo, vo->params, flags); + vo->config_ok = ret >= 0; vo->config_count += vo->config_ok; if (!vo->config_ok) { talloc_free(vo->params); |