changeset 35589:ba53cfe2547b

lavf muxer: set up stream aspect.
author reimar
date Sat, 15 Dec 2012 19:33:19 +0000
parents dc5355a5b42f
children 388b4cc85c0e
files libmpdemux/muxer_lavf.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_lavf.c	Fri Dec 14 17:51:19 2012 +0000
+++ b/libmpdemux/muxer_lavf.c	Sat Dec 15 19:33:19 2012 +0000
@@ -228,6 +228,10 @@
 		ctx->bit_rate = 800000;
 		ctx->time_base.den = stream->h.dwRate;
 		ctx->time_base.num = stream->h.dwScale;
+		if (stream->aspect)
+			ctx->sample_aspect_ratio =
+			spriv->avstream->sample_aspect_ratio = av_d2q(stream->aspect * ctx->height / ctx->width, 255);
+
 		if(stream->bih->biSize > sizeof(*stream->bih))
 		{
 			ctx->extradata_size = stream->bih->biSize - sizeof(*stream->bih);