This commit also correctly marks the interlace type of adam7
which does not correspond to bff or tff interlacing.
---
 libavcodec/pngdec.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index e646296..5b82d5b 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -493,9 +493,13 @@ static int decode_frame(AVCodecContext *avctx,
                     av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
                     goto fail;
                 }
-                p->pict_type        = AV_PICTURE_TYPE_I;
-                p->key_frame        = 1;
-                p->interlaced_frame = !!s->interlace_type;
+                p->pict_type = AV_PICTURE_TYPE_I;
+                p->key_frame = 1;
+                if (s->interlace_type)
+                    // adam7 is only for displaying faster at compression cost
+                    p->field_state = AV_FRAME_INTERLACED;
+                else
+                    p->field_state = AV_FRAME_PROGRESSIVE;
 
                 /* compute the compressed row size */
                 if (!s->interlace_type) {
-- 
1.7.9.5

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to