diff options
-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; |