mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user