diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-10-13 09:26:09 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-10-13 16:02:09 +0000 |
commit | f58f90238fc63090da34c9fdb1d06d724d929f6d (patch) | |
tree | 40f5ab0ac113d6242d8958c986df0a8828b7b01e /libavcodec | |
parent | 8288c2b6cb072b61f664bc8ab4c1b0a5a8db0ead (diff) | |
download | ffmpeg-f58f90238fc63090da34c9fdb1d06d724d929f6d.tar.gz |
pngenc: write sample aspect ratio
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pngenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 87d18d491a..c91f28941f 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -335,6 +335,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, png_write_chunk(&s->bytestream, MKTAG('I', 'H', 'D', 'R'), s->buf, 13); + AV_WB32(s->buf, avctx->sample_aspect_ratio.num); + AV_WB32(s->buf + 4, avctx->sample_aspect_ratio.den); + s->buf[8] = 0; /* unit specifier is unknown */ + png_write_chunk(&s->bytestream, MKTAG('p', 'H', 'Y', 's'), s->buf, 9); + /* put the palette if needed */ if (color_type == PNG_COLOR_TYPE_PALETTE) { int has_alpha, alpha, i; |