summaryrefslogtreecommitdiffstats
path: root/player/screenshot.c
diff options
context:
space:
mode:
authorMartin Herkt <lachs0r@srsfckn.biz>2016-06-25 02:25:44 +0200
committerMartin Herkt <lachs0r@srsfckn.biz>2016-06-25 02:25:44 +0200
commitad56f2c46ac6deec86870ec10f2a11a644df07d4 (patch)
tree89f2d90c5586560911e67c872b530c77f151168d /player/screenshot.c
parent0536841647ef7931bffb4386d8ffbb5b2b568e8a (diff)
parent393bb2a565dc1e27812e1dd20747814892f80da2 (diff)
downloadmpv-ad56f2c46ac6deec86870ec10f2a11a644df07d4.tar.bz2
mpv-ad56f2c46ac6deec86870ec10f2a11a644df07d4.tar.xz
Merge branch 'master' into release/current
Diffstat (limited to 'player/screenshot.c')
-rw-r--r--player/screenshot.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/player/screenshot.c b/player/screenshot.c
index 02cbb4a500..13532ec1a3 100644
--- a/player/screenshot.c
+++ b/player/screenshot.c
@@ -287,9 +287,10 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext)
void *t = fname;
dir = mp_get_user_path(t, ctx->mpctx->global, dir);
fname = mp_path_join(NULL, dir, fname);
- talloc_free(t);
mp_mkdirp(dir);
+
+ talloc_free(t);
}
if (!mp_path_exists(fname))
@@ -345,8 +346,9 @@ static struct mp_image *screenshot_get(struct MPContext *mpctx, int mode)
}
}
- if (image && mpctx->vo_chain && mpctx->vo_chain->hwdec_info) {
- struct mp_hwdec_ctx *ctx = mpctx->vo_chain->hwdec_info->hwctx;
+ if (image && mpctx->vo_chain && mpctx->vo_chain->hwdec_devs) {
+ struct mp_hwdec_ctx *ctx =
+ hwdec_devices_get_first(mpctx->vo_chain->hwdec_devs);
struct mp_image *nimage = NULL;
if (ctx && ctx->download_image && (image->fmt.flags & MP_IMGFLAG_HWACCEL))
nimage = ctx->download_image(ctx, image, NULL);