diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-04 09:09:14 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-23 13:41:05 +0300 |
commit | b91826280c468b1b5b4baf6e0225dfdb878e214a (patch) | |
tree | 79b12d96746904a73de036d82a10b1c43f3899da /libvo | |
parent | 461264756ec9adbb6fa8294aeacd3fbf50f17c46 (diff) | |
download | mpv-b91826280c468b1b5b4baf6e0225dfdb878e214a.tar.bz2 mpv-b91826280c468b1b5b4baf6e0225dfdb878e214a.tar.xz |
vo_xv.c: Make reconfig logic more robust
The previous version was not buggy, but this is easier to see correct.
Now it doesn't depend on options determining num_buffers staying
constant and on vo_config_count.
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/vo_xv.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index 18a0aed088..b7c24948af 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -198,10 +198,6 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, ctx->is_paused = 0; ctx->visible_buf = -1; - - ctx->num_buffers = - vo_doublebuffering ? (vo_directrendering ? NUM_BUFFERS : 2) : 1; - /* check image formats */ ctx->xv_format = 0; for (i = 0; i < ctx->formats; i++) { @@ -340,9 +336,12 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, ctx->draw_alpha_fnc = draw_alpha_null; } - if (vo_config_count) - for (i = 0; i < ctx->num_buffers; i++) - deallocate_xvimage(vo, i); + // In case config has been called before + for (i = 0; i < ctx->num_buffers; i++) + deallocate_xvimage(vo, i); + + ctx->num_buffers = + vo_doublebuffering ? (vo_directrendering ? NUM_BUFFERS : 2) : 1; for (i = 0; i < ctx->num_buffers; i++) allocate_xvimage(vo, i); |