diff options
author | wm4 <wm4@nowhere> | 2016-01-14 00:18:31 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-01-14 00:18:31 +0100 |
commit | bf13bd0d47e5fc6761c51c6ba7056968e60bf4cd (patch) | |
tree | a031821a03564128a5e0dabb0a33361fd56b0e07 /player/video.c | |
parent | dd973da108165ebb95e856dbc82326cb35fb45a5 (diff) | |
download | mpv-bf13bd0d47e5fc6761c51c6ba7056968e60bf4cd.tar.bz2 mpv-bf13bd0d47e5fc6761c51c6ba7056968e60bf4cd.tar.xz |
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.
Diffstat (limited to 'player/video.c')
-rw-r--r-- | player/video.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; } |