diff options
author | wm4 <wm4@nowhere> | 2014-04-29 15:18:19 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-02 01:08:05 +0200 |
commit | 90a039a5991c20c3a185667348bf7c69dbb4cd19 (patch) | |
tree | 47c39ed0218203b0211aa3b86689e9ecd5b1a432 | |
parent | 3f060a19d84bfef8ea08b81399b16c8414053700 (diff) | |
download | mpv-90a039a5991c20c3a185667348bf7c69dbb4cd19.tar.bz2 mpv-90a039a5991c20c3a185667348bf7c69dbb4cd19.tar.xz |
command, vo_vdpau: respect vdpau deint sub-option
This is a horrible hack to keep compatibility with the vo_vdpau deint
sub-option.
-rw-r--r-- | player/command.c | 17 | ||||
-rw-r--r-- | video/out/vo.h | 2 | ||||
-rw-r--r-- | video/out/vo_vdpau.c | 3 |
3 files changed, 20 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c index 55e01ac77f..4d0473f4c2 100644 --- a/player/command.c +++ b/player/command.c @@ -1552,9 +1552,22 @@ static bool check_output_format(struct MPContext *mpctx, int imgfmt) static int probe_deint_filters(struct MPContext *mpctx) { #if HAVE_VDPAU - if (check_output_format(mpctx, IMGFMT_VDPAU) && - probe_deint_filter(mpctx, "vdpaupp:deint=yes")) + if (check_output_format(mpctx, IMGFMT_VDPAU)) { + char filter[80] = "vdpaupp:deint=yes"; + int pref = 0; + if (mpctx->video_out) + vo_control(mpctx->video_out, VOCTRL_GET_PREF_DEINT, &pref); + pref = pref < 0 ? -pref : pref; + if (pref > 0 && pref <= 4) { + const char *types[] = + {"", "first-field", "bob", "temporal", "temporal-spatial"}; + mp_snprintf_append(filter, sizeof(filter), ":deint-mode=%s", + types[pref]); + } + + probe_deint_filter(mpctx, filter); return 0; + } #endif #if HAVE_VAAPI_VPP if (check_output_format(mpctx, IMGFMT_VAAPI) && diff --git a/video/out/vo.h b/video/out/vo.h index 629e25e0b0..26c90d184a 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -85,6 +85,8 @@ enum mp_voctrl { VOCTRL_SET_COMMAND_LINE, // char** VOCTRL_GET_ICC_PROFILE_PATH, // char** + + VOCTRL_GET_PREF_DEINT, // int* }; // VOCTRL_SET_EQUALIZER diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index fbcb1e9917..97b8245401 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -1278,6 +1278,9 @@ static int control(struct vo *vo, uint32_t request, void *data) args->out_image = get_screenshot(vo); return true; } + case VOCTRL_GET_PREF_DEINT: + *(int *)data = vc->deint; + return true; } int events = 0; |