diff options
author | Martin Herkt <lachs0r@srsfckn.biz> | 2016-01-18 07:27:03 +0100 |
---|---|---|
committer | Martin Herkt <lachs0r@srsfckn.biz> | 2016-01-18 07:27:03 +0100 |
commit | ba9b2f1e49732d597009ba514b0132a50562cd10 (patch) | |
tree | fa05f5feb181823ac9d3b5682a835ff825de6914 /player/screenshot.c | |
parent | e1993d5ad2bdf3dd4c26474aaa2370cbc9c1cd1b (diff) | |
parent | 7b4ccb3e9f58a0745b58e473ee6e60b381242813 (diff) | |
download | mpv-ba9b2f1e49732d597009ba514b0132a50562cd10.tar.bz2 mpv-ba9b2f1e49732d597009ba514b0132a50562cd10.tar.xz |
Merge branch 'master' into release/current
Diffstat (limited to 'player/screenshot.c')
-rw-r--r-- | player/screenshot.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/player/screenshot.c b/player/screenshot.c index 9c4f5cc84e..4ab0653fd4 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -23,7 +23,7 @@ #include "osdep/io.h" -#include "talloc.h" +#include "mpv_talloc.h" #include "screenshot.h" #include "core.h" #include "command.h" @@ -308,14 +308,7 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext) static void add_subs(struct MPContext *mpctx, struct mp_image *image) { - double sar = (double)image->w / image->h; - double dar = (double)image->params.d_w / image->params.d_h; - struct mp_osd_res res = { - .w = image->w, - .h = image->h, - .display_par = sar / dar, - }; - + struct mp_osd_res res = osd_res_from_image_params(&image->params); osd_draw_on_image(mpctx->osd, res, mpctx->video_pts, OSD_DRAW_SUB_ONLY, image); } @@ -352,8 +345,8 @@ static struct mp_image *screenshot_get(struct MPContext *mpctx, int mode) } } - if (image && mpctx->d_video && mpctx->d_video->hwdec_info) { - struct mp_hwdec_ctx *ctx = mpctx->d_video->hwdec_info->hwctx; + if (image && mpctx->vo_chain && mpctx->vo_chain->hwdec_info) { + struct mp_hwdec_ctx *ctx = mpctx->vo_chain->hwdec_info->hwctx; struct mp_image *nimage = NULL; if (ctx && ctx->download_image && (image->fmt.flags & MP_IMGFLAG_HWACCEL)) nimage = ctx->download_image(ctx, image, NULL); |