video: handle override video parameters in a better place

This really shouldn't be in vd_lavc.c - move it to dec_video.c, where it
also applies aspect overrides. This makes all overrides in one place.
The previous commit contains some required changes for resetting the
image parameters change detection (i.e. it's not done only on video
aspect override changes).
This commit is contained in:
wm4 2016-09-20 15:38:19 +02:00
parent e13eb3fede
commit 23639e5b0e
2 changed files with 7 additions and 8 deletions

View File

@ -236,6 +236,13 @@ static void fix_image_params(struct dec_video *d_video,
if (p.p_w <= 0 || p.p_h <= 0)
p.p_w = p.p_h = 1;
if (opts->video_rotate < 0) {
p.rotate = 0;
} else {
p.rotate = (p.rotate + opts->video_rotate) % 360;
}
p.stereo_out = opts->video_stereo_mode;
// Detect colorspace from resolution.
mp_image_params_guess_csp(&p);

View File

@ -592,7 +592,6 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame,
struct mp_image_params *out_params)
{
vd_ffmpeg_ctx *ctx = vd->priv;
struct MPOpts *opts = ctx->opts;
#if HAVE_AVUTIL_MASTERING_METADATA
// Get the reference peak (for HDR) if available. This is cached into ctx
@ -632,13 +631,6 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame,
.rotate = vd->codec->rotate,
.stereo_in = vd->codec->stereo_mode,
};
if (opts->video_rotate < 0) {
out_params->rotate = 0;
} else {
out_params->rotate = (out_params->rotate + opts->video_rotate) % 360;
}
out_params->stereo_out = opts->video_stereo_mode;
}
static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx,