f_auto_filters: always fall back to hw-download+yadif if no hw deint filter

If hw decoding is used, but no hw deinterlacer is available, even though
we expect that it is present, fall back to using hw-download and yadif
anyway. Until now, it was over if the hw filter was somehow missing; for
example, yadif_cuda apparently requires a full Cuda SDK, so it can be
missing, even if nvdec is available. (Whether this particular case works
was not tested with this commit.)

Fixes: #7465
This commit is contained in:
wm4 2020-02-16 15:28:57 +01:00
parent 7d11eda72e
commit a19d918816
1 changed files with 8 additions and 3 deletions

View File

@ -68,6 +68,7 @@ static void deint_process(struct mp_filter *f)
return;
}
bool has_filter = true;
if (img->imgfmt == IMGFMT_VDPAU) {
char *args[] = {"deint", "yes", NULL};
p->sub.filter =
@ -80,6 +81,13 @@ static void deint_process(struct mp_filter *f)
p->sub.filter =
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "yadif_cuda", args);
} else {
has_filter = false;
}
if (!p->sub.filter) {
if (has_filter)
MP_ERR(f, "creating deinterlacer failed\n");
struct mp_filter *subf = mp_bidir_dummy_filter_create(f);
struct mp_filter *filters[2] = {0};
@ -106,9 +114,6 @@ static void deint_process(struct mp_filter *f)
p->sub.filter = subf;
}
if (!p->sub.filter)
MP_ERR(f, "creating deinterlacer failed\n");
mp_subfilter_continue(&p->sub);
}