]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pngenc.c
asfdec: ignore stored duration for truncated files
[ffmpeg] / libavcodec / pngenc.c
index 87d18d491af14bfbd324fe20a020ee47d0c3f373..c91f28941fac920c337e9b55536e59013f401def 100644 (file)
@@ -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;