summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-23 15:43:42 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-23 15:43:42 +0000
commite8566ce09624da49c4749feca58f3d3e85176585 (patch)
treee8e4437adb13f767efc65580b20d635ab67fe2e5 /libvo
parent239933c040abb71bbd06912cb03cc8e1cf77227f (diff)
downloadmpv-e8566ce09624da49c4749feca58f3d3e85176585.tar.bz2
mpv-e8566ce09624da49c4749feca58f3d3e85176585.tar.xz
Set aspect information in yuv4mpeg
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20414 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_yuv4mpeg.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libvo/vo_yuv4mpeg.c b/libvo/vo_yuv4mpeg.c
index 3a1f2cec72..3e0b682154 100644
--- a/libvo/vo_yuv4mpeg.c
+++ b/libvo/vo_yuv4mpeg.c
@@ -41,6 +41,7 @@
#include "fastmemcpy.h"
#include "libswscale/swscale.h"
#include "libmpcodecs/vf_scale.h"
+#include "libavutil/rational.h"
static vo_info_t info =
{
@@ -82,6 +83,8 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
uint32_t d_height, uint32_t flags, char *title,
uint32_t format)
{
+ AVRational pixelaspect = av_div_q((AVRational){d_width, d_height},
+ (AVRational){width, height});
if (image_width == width && image_height == height &&
image_fps == vo_fps && vo_config_count)
return 0;
@@ -153,14 +156,10 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
image_u = image_y + image_width * image_height;
image_v = image_u + image_width * image_height / 4;
- // This isn't right.
- // But it should work as long as the file isn't interlaced
- // or otherwise unusual (the "Ip A0:0" part).
-
- /* At least the interlacing is ok now */
- fprintf(yuv_out, "YUV4MPEG2 W%d H%d F%ld:%ld I%c A0:0\n",
+ fprintf(yuv_out, "YUV4MPEG2 W%d H%d F%ld:%ld I%c A%"PRId64":%"PRId64"\n",
image_width, image_height, (long)(image_fps * 1000000.0),
- (long)1000000, config_interlace);
+ (long)1000000, config_interlace,
+ pixelaspect.num, pixelaspect.den);
fflush(yuv_out);
return 0;