mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 07:42:17 +00:00
video: fix deinterlace filter handling on pixel format changes
The test scenario at hand was hardware decoding a file with d3d11 and with deinterlacing enabled. The file switches to a non-hardware dedocdeable format mid-stream. This failed, because it tried to call vf_reconfig() with the old filters inserted, with was fatal due to vf_d3d11vpp accepting only hardware input formats. Fix this by always strictly removing all auto-inserted filters (including the deinterlacing one), and reconfiguring only after that. Note that this change is good for other situations too, because we generally don't want to use a hardware deinterlacer for software decoding by default. They're not necessarily optimal, and VAAPI VPP even has incomprehensible deinterlacer bugs specifically with software frames not coming from a hardware decoder.
This commit is contained in:
parent
fc76966d9e
commit
0b1ef81498
@ -193,19 +193,16 @@ static void filter_reconfig(struct MPContext *mpctx, struct vo_chain *vo_c)
|
||||
|
||||
set_allowed_vo_formats(vo_c);
|
||||
|
||||
if (vf_reconfig(vo_c->vf, ¶ms) < 0)
|
||||
return;
|
||||
|
||||
char *filters[] = {"autorotate", "autostereo3d", "deinterlace", NULL};
|
||||
for (int n = 0; filters[n]; n++) {
|
||||
struct vf_instance *vf = vf_find_by_label(vo_c->vf, filters[n]);
|
||||
if (vf) {
|
||||
if (vf)
|
||||
vf_remove_filter(vo_c->vf, vf);
|
||||
if (vf_reconfig(vo_c->vf, ¶ms) < 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (vf_reconfig(vo_c->vf, ¶ms) < 0)
|
||||
return;
|
||||
|
||||
if (params.rotate && (params.rotate % 90 == 0)) {
|
||||
if (!(vo_c->vo->driver->caps & VO_CAP_ROTATE90)) {
|
||||
// Try to insert a rotation filter.
|
||||
|
Loading…
Reference in New Issue
Block a user