summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-24 14:08:39 +0200
committerwm4 <wm4@nowhere>2014-05-24 16:17:52 +0200
commit6125ba613f019a011dcd0873f1b448e859c15634 (patch)
tree459720d56307a1a64082b4cdb8291edf61417041 /video
parent8665f7801837ac29f0171437e1c1cb7d6d51e410 (diff)
downloadmpv-6125ba613f019a011dcd0873f1b448e859c15634.tar.bz2
mpv-6125ba613f019a011dcd0873f1b448e859c15634.tar.xz
video: add --video-rotate option for controlling auto-rotation
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c7
1 files changed, 7 insertions, 0 deletions
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,