From 0a0bb9059f42671c267ea5d0c8faa3ac71a8c742 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 19 Dec 2015 20:04:31 +0100 Subject: video: switch from using display aspect to sample aspect MPlayer traditionally always used the display aspect ratio, e.g. 16:9, while FFmpeg uses the sample (aka pixel) aspect ratio. Both have a bunch of advantages and disadvantages. Actually, it seems using sample aspect ratio is generally nicer. The main reason for the change is making mpv closer to how FFmpeg works in order to make life easier. It's also nice that everything uses integer fractions instead of floats now (except --video-aspect option/property). Note that there is at least 1 user-visible change: vf_dsize now does not set the display size, only the display aspect ratio. This is because the image_params d_w/d_h fields did not just set the display aspect, but also the size (except in encoding mode). --- player/screenshot.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'player/screenshot.c') diff --git a/player/screenshot.c b/player/screenshot.c index 9c4f5cc84e..76c7874498 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -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); } -- cgit v1.2.3 From ea442fa047819ec2e48a3dbe8ea21959ac3d70b0 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Mon, 11 Jan 2016 19:03:40 +0100 Subject: mpv_talloc.h: rename from talloc.h This change helps avoiding conflict with talloc.h from libtalloc. --- player/screenshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/screenshot.c') diff --git a/player/screenshot.c b/player/screenshot.c index 76c7874498..3fc0b90c98 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" -- cgit v1.2.3 From 4195a345a51e52337bc972aacbce0fd6e88ebb5d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 17 Jan 2016 18:07:50 +0100 Subject: player: refactor: eliminate MPContext.d_video Eventually we want the VO be driven by a A->V filter, so a decoder doesn't even have to exist. Some features definitely require a decoder though (like reporting the decoder in use, hardware decoding, etc.), so for each thing which accessed d_video, it has to be redecided if and how it can access decoder state. At least the "framedrop" property slightly changes semantics: you can now always set this property, even if no video is active. Some untested changes in this commit, but our bio-based distributed test suite has to take care of this. --- player/screenshot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player/screenshot.c') diff --git a/player/screenshot.c b/player/screenshot.c index 3fc0b90c98..4ab0653fd4 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -345,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); -- cgit v1.2.3