diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-08-10 14:23:18 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-08-10 14:23:18 +0000 |
commit | 0a5790d1a9f86cde715f747b0a4fee8ea2076530 (patch) | |
tree | 3ebefe512edaa796690802bd6ae19a87321d77d8 /libavformat | |
parent | 272872e44b29a3b0e362ed67824f0820efe19d1d (diff) | |
download | ffmpeg-0a5790d1a9f86cde715f747b0a4fee8ea2076530.tar.gz |
ensure that the aspect ratio is spec compliant
Originally committed as revision 10056 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/nutenc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 64e92406bb..dbecf62253 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -301,8 +301,14 @@ static int write_streamheader(NUTContext *nut, ByteIOContext *bc, AVCodecContext case CODEC_TYPE_VIDEO: put_v(bc, codec->width); put_v(bc, codec->height); - put_v(bc, codec->sample_aspect_ratio.num); - put_v(bc, codec->sample_aspect_ratio.den); + + if(codec->sample_aspect_ratio.num<=0 || codec->sample_aspect_ratio.den<=0){ + put_v(bc, 0); + put_v(bc, 0); + }else{ + put_v(bc, codec->sample_aspect_ratio.num); + put_v(bc, codec->sample_aspect_ratio.den); + } put_v(bc, 0); /* csp type -- unknown */ break; default: |