mirror of https://github.com/mpv-player/mpv
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:
parent
7d11eda72e
commit
a19d918816
|
@ -68,6 +68,7 @@ static void deint_process(struct mp_filter *f)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool has_filter = true;
|
||||||
if (img->imgfmt == IMGFMT_VDPAU) {
|
if (img->imgfmt == IMGFMT_VDPAU) {
|
||||||
char *args[] = {"deint", "yes", NULL};
|
char *args[] = {"deint", "yes", NULL};
|
||||||
p->sub.filter =
|
p->sub.filter =
|
||||||
|
@ -80,6 +81,13 @@ static void deint_process(struct mp_filter *f)
|
||||||
p->sub.filter =
|
p->sub.filter =
|
||||||
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "yadif_cuda", args);
|
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "yadif_cuda", args);
|
||||||
} else {
|
} 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 *subf = mp_bidir_dummy_filter_create(f);
|
||||||
struct mp_filter *filters[2] = {0};
|
struct mp_filter *filters[2] = {0};
|
||||||
|
|
||||||
|
@ -106,9 +114,6 @@ static void deint_process(struct mp_filter *f)
|
||||||
p->sub.filter = subf;
|
p->sub.filter = subf;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!p->sub.filter)
|
|
||||||
MP_ERR(f, "creating deinterlacer failed\n");
|
|
||||||
|
|
||||||
mp_subfilter_continue(&p->sub);
|
mp_subfilter_continue(&p->sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue