diff options
-rw-r--r-- | video/out/vo_sixel.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/video/out/vo_sixel.c b/video/out/vo_sixel.c index f4ba8db7c7..cc5cc34ecc 100644 --- a/video/out/vo_sixel.c +++ b/video/out/vo_sixel.c @@ -117,7 +117,7 @@ static int detect_scene_change(struct vo* vo) } -static void dealloc_dithers_and_buffer(struct vo* vo) +static void dealloc_dithers_and_buffers(struct vo* vo) { struct priv* priv = vo->priv; @@ -126,6 +126,11 @@ static void dealloc_dithers_and_buffer(struct vo* vo) priv->buffer = NULL; } + if (priv->frame) { + talloc_free(priv->frame); + priv->frame = NULL; + } + if (priv->dither) { sixel_dither_unref(priv->dither); priv->dither = NULL; @@ -288,6 +293,8 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) .p_h = 1, }; + dealloc_dithers_and_buffers(vo); + priv->frame = mp_image_alloc(IMGFMT, priv->width, priv->height); if (!priv->frame) return -1; @@ -299,8 +306,6 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) printf(ESC_CLEAR_SCREEN); vo->want_redraw = true; - dealloc_dithers_and_buffer(vo); - // create testdither only if dynamic palette mode is set if (!priv->opt_fixedpal) { SIXELSTATUS status = sixel_dither_new(&priv->testdither, @@ -483,7 +488,7 @@ static void uninit(struct vo *vo) priv->output = NULL; } - dealloc_dithers_and_buffer(vo); + dealloc_dithers_and_buffers(vo); } #define OPT_BASE_STRUCT struct priv |