summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-08 14:48:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-08 15:00:36 +0100
commitb28c37156782e563341e1bccc1a15dfbc01a569f (patch)
treefc8ef8978bf3d9fd44248d3e4ec2caed36edcd3f /libavdevice
parent24e2a82f75abbe977b7ddab52a90ce4d3e57a9f8 (diff)
parent6bffa83bbeac4820f7705188e20f2e307e832fd7 (diff)
Merge remote-tracking branch 'cigaes/master'
* cigaes/master: lavf/concatdec: reindent after last commit. lavf/concatdec: more reliable test for absolute URLs. lavf: add subfile protocol. lavfi/af_atempo: clear references before returning error. lavd/xv: take aspect ratio into account. lavc/pthread: copy packet side data. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/xv.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavdevice/xv.c b/libavdevice/xv.c
index ab08e3e0f7..2948e6d9b7 100644
--- a/libavdevice/xv.c
+++ b/libavdevice/xv.c
@@ -130,8 +130,15 @@ static int xv_write_header(AVFormatContext *s)
xv->image_width = encctx->width;
xv->image_height = encctx->height;
if (!xv->window_width && !xv->window_height) {
+ AVRational sar = encctx->sample_aspect_ratio;
xv->window_width = encctx->width;
xv->window_height = encctx->height;
+ if (sar.num) {
+ if (sar.num > sar.den)
+ xv->window_width = av_rescale(xv->window_width, sar.num, sar.den);
+ if (sar.num < sar.den)
+ xv->window_height = av_rescale(xv->window_height, sar.den, sar.num);
+ }
}
xv->window = XCreateSimpleWindow(xv->display, DefaultRootWindow(xv->display),
xv->window_x, xv->window_y,