ffmpeg | branch: master | Anton Khirnov <[email protected]> | Tue Jul 12 
14:37:15 2022 +0200| [bbbafab0ee8b5ac15150d3b6c8129d7dbcbe6603] | committer: 
Anton Khirnov

lavc/pngenc: handle frame durations and AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bbbafab0ee8b5ac15150d3b6c8129d7dbcbe6603
---

 libavcodec/pngenc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 5166698b8a..535a46b507 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -964,6 +964,11 @@ static int encode_apng(AVCodecContext *avctx, AVPacket 
*pkt,
 
         memcpy(pkt->data, s->last_frame_packet, s->last_frame_packet_size);
         pkt->pts = pkt->dts = s->last_frame->pts;
+        pkt->duration = s->last_frame->duration;
+
+        ret = ff_encode_reordered_opaque(avctx, pkt, s->last_frame);
+        if (ret < 0)
+            return ret;
     }
 
     if (pict) {
@@ -1206,7 +1211,8 @@ const FFCodec ff_apng_encoder = {
     CODEC_LONG_NAME("APNG (Animated Portable Network Graphics) image"),
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_APNG,
-    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+                      AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .priv_data_size = sizeof(PNGEncContext),
     .init           = png_enc_init,
     .close          = png_enc_close,

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to