From a357d39369737f2f6608c669fac13d26e6c6b33a Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 21 Jul 2015 21:54:15 +0200 Subject: 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. --- player/video.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 57ec9d64d1..763f2e5a81 100644 --- a/player/video.c +++ b/player/video.c @@ -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. -- cgit v1.2.3