1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 00:42:57 +00:00

command, vo_vdpau: respect vdpau deint sub-option

This is a horrible hack to keep compatibility with the vo_vdpau deint
sub-option.
This commit is contained in:
wm4 2014-04-29 15:18:19 +02:00
parent 3f060a19d8
commit 90a039a599
3 changed files with 20 additions and 2 deletions

View File

@ -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) &&

View File

@ -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

View File

@ -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;