From 6125ba613f019a011dcd0873f1b448e859c15634 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 24 May 2014 14:08:39 +0200 Subject: video: add --video-rotate option for controlling auto-rotation --- video/decode/vd_lavc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 1ba579abed..2593e50285 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -420,6 +420,7 @@ 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; int width = frame->width; int height = frame->height; float aspect = av_q2d(frame->sample_aspect_ratio) * width / height; @@ -448,6 +449,12 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame, avchroma_location_to_mp(ctx->avctx->chroma_sample_location), .rotate = vd->header->video->rotate, }; + + if (opts->video_rotate < 0) { + out_params->rotate = 0; + } else { + out_params->rotate = (out_params->rotate + opts->video_rotate) % 360; + } } static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx, -- cgit v1.2.3