summaryrefslogtreecommitdiffstats
path: root/video/out/vo_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/vo_image.c')
-rw-r--r--video/out/vo_image.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index 15c1a34498..84e164f6e5 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -24,7 +24,6 @@
#include <libswscale/swscale.h>
-#include "config.h"
#include "misc/bstr.h"
#include "osdep/io.h"
#include "options/m_config.h"
@@ -88,20 +87,19 @@ static bool checked_mkdir(struct vo *vo, const char *buf)
static int reconfig(struct vo *vo, struct mp_image_params *params)
{
- struct priv *p = vo->priv;
- mp_image_unrefp(&p->current);
-
return 0;
}
-static void draw_image(struct vo *vo, mp_image_t *mpi)
+static void draw_frame(struct vo *vo, struct vo_frame *frame)
{
struct priv *p = vo->priv;
+ if (!frame->current)
+ return;
- p->current = mpi;
+ p->current = frame->current;
struct mp_osd_res dim = osd_res_from_image_params(vo->params);
- osd_draw_on_image(vo->osd, dim, mpi->pts, OSD_DRAW_SUB_ONLY, p->current);
+ osd_draw_on_image(vo->osd, dim, frame->current->pts, OSD_DRAW_SUB_ONLY, p->current);
}
static void flip_page(struct vo *vo)
@@ -120,10 +118,9 @@ static void flip_page(struct vo *vo)
filename = mp_path_join(t, p->opts->outdir, filename);
MP_INFO(vo, "Saving %s\n", filename);
- write_image(p->current, p->opts->opts, filename, vo->global, vo->log);
+ write_image(p->current, p->opts->opts, filename, vo->global, vo->log, true);
talloc_free(t);
- mp_image_unrefp(&p->current);
}
static int query_format(struct vo *vo, int fmt)
@@ -135,9 +132,6 @@ static int query_format(struct vo *vo, int fmt)
static void uninit(struct vo *vo)
{
- struct priv *p = vo->priv;
-
- mp_image_unrefp(&p->current);
}
static int preinit(struct vo *vo)
@@ -164,7 +158,7 @@ const struct vo_driver video_out_image =
.query_format = query_format,
.reconfig = reconfig,
.control = control,
- .draw_image = draw_image,
+ .draw_frame = draw_frame,
.flip_page = flip_page,
.uninit = uninit,
.global_opts = &vo_image_conf,