From bf13bd0d47e5fc6761c51c6ba7056968e60bf4cd Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 14 Jan 2016 00:18:31 +0100 Subject: video: refactor: handle video format fixups closer to decoder Instead of handling this on filter chain reinit, do it directly after the decoder. This makes the code less entangled. In particular, this gets rid of the really weird "override params" concept in the video filter code. The last_format/fixed_formats have some redundance with decoder_output, but unfortunately the latter has a slightly different use. --- player/video.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 33f3b4b970..9ec7eacb74 100644 --- a/player/video.c +++ b/player/video.c @@ -84,10 +84,10 @@ static int try_filter(struct MPContext *mpctx, struct mp_image_params params, vf->label = talloc_strdup(vf, label); - if (video_reconfig_filters(d_video, ¶ms) < 0) { + if (vf_reconfig(d_video->vfilter, ¶ms) < 0) { vf_remove_filter(d_video->vfilter, vf); // restore - video_reconfig_filters(d_video, ¶ms); + vf_reconfig(d_video->vfilter, ¶ms); return -1; } return 0; @@ -107,7 +107,7 @@ static void filter_reconfig(struct MPContext *mpctx, set_allowed_vo_formats(d_video->vfilter, mpctx->video_out); - if (video_reconfig_filters(d_video, ¶ms) < 0) { + if (vf_reconfig(d_video->vfilter, ¶ms) < 0) { // Most video filters don't work with hardware decoding, so this // might be the reason why filter reconfig failed. if (!probe_only && @@ -119,6 +119,8 @@ static void filter_reconfig(struct MPContext *mpctx, mp_image_unrefp(&d_video->waiting_decoded_mpi); d_video->decoder_output = (struct mp_image_params){0}; MP_VERBOSE(mpctx, "hwdec falback due to filters.\n"); + } else { + MP_FATAL(mpctx, "Cannot initialize video filters.\n"); } return; } -- cgit v1.2.3