video: always re-probe auto deint filter on filter reconfig

If filters are disabled or reconfigured, attempt to remove and probe the
deinterlace filter again. This fixes behavior if e.g. a software deint
filter was automatically inserted, and then hardware decoding is enabled
during playback. Without this commit, initializing hw decoding would
fail because of the software filter; with this commit, it'll replace it
with the hw deinterlacer instead.
This commit is contained in:
wm4
2015-07-21 21:54:15 +02:00
parent e5fac76b3b
commit a357d39369
3 changed files with 24 additions and 10 deletions

View File

@@ -231,6 +231,7 @@ void uninit_video_chain(struct MPContext *mpctx)
mpctx->video_status = STATUS_EOF;
mpctx->sync_audio_to_video = false;
reselect_demux_streams(mpctx);
remove_deint_filter(mpctx);
}
mp_notify(mpctx, MPV_EVENT_VIDEO_RECONFIG, NULL);
}
@@ -423,8 +424,10 @@ static void init_filter_params(struct MPContext *mpctx)
// recreate the chain a second time, which is not very elegant, but allows
// us to test whether enabling deinterlacing works with the current video
// format and other filters.
if (opts->deinterlace >= 0)
mp_property_do("deinterlace", M_PROPERTY_SET, &opts->deinterlace, mpctx);
if (opts->deinterlace >= 0) {
remove_deint_filter(mpctx);
set_deinterlacing(mpctx, opts->deinterlace != 0);
}
}
// Feed newly decoded frames to the filter, take care of format changes.