From 695172f63e9a8e440d41f50f08af89aa69c602e6 Mon Sep 17 00:00:00 2001 From: cloud11665 Date: Sat, 1 Apr 2023 22:03:49 +0200 Subject: [PATCH] player/screenshot: add "screenshot" logger --- player/screenshot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/player/screenshot.c b/player/screenshot.c index c6c089b052..1feeba2133 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -21,6 +21,7 @@ #include +#include "common/global.h" #include "osdep/io.h" #include "mpv_talloc.h" @@ -48,6 +49,7 @@ typedef struct screenshot_ctx { struct MPContext *mpctx; + struct mp_log *log; // Command to repeat in each-frame mode. struct mp_cmd *each_frame; @@ -62,6 +64,7 @@ void screenshot_init(struct MPContext *mpctx) *mpctx->screenshot_ctx = (screenshot_ctx) { .mpctx = mpctx, .frameno = 1, + .log = mp_log_new(mpctx, mpctx->log, "screenshot") }; } @@ -85,7 +88,7 @@ static bool write_screenshot(struct mp_cmd_ctx *cmd, struct mp_image *img, mp_core_unlock(mpctx); bool ok = img && write_image(img, &opts_copy, filename, mpctx->global, - mpctx->log); + mpctx->screenshot_ctx->log); mp_core_lock(mpctx);