diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-05-20 14:13:27 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-05-25 19:51:56 +0200 |
commit | c6b6356635f598b095606cd126f31bc6ab916225 (patch) | |
tree | 0dd9d0b2911b1d257efe7074232b0a11bb996fe4 /libavcodec/gifdec.c | |
parent | e7cadd0ee5a3d0da64b6c9a66b6609aef8e1977d (diff) | |
download | ffmpeg-c6b6356635f598b095606cd126f31bc6ab916225.tar.gz |
avformat/gifdec: switch to using gif parser
Update fate test, more correct as last packet is not truncated.
Diffstat (limited to 'libavcodec/gifdec.c')
-rw-r--r-- | libavcodec/gifdec.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 0835c5bdd0..f2ab783ef0 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -472,10 +472,6 @@ static int gif_decode_frame(AVCodecContext *avctx, AVFrame *rframe, bytestream2_init(&s->gb, avpkt->data, avpkt->size); - s->frame->pts = avpkt->pts; - s->frame->pkt_dts = avpkt->dts; - s->frame->duration = avpkt->duration; - if (avpkt->size >= 6) { s->keyframe = memcmp(avpkt->data, gif87a_sig, 6) == 0 || memcmp(avpkt->data, gif89a_sig, 6) == 0; @@ -522,6 +518,13 @@ static int gif_decode_frame(AVCodecContext *avctx, AVFrame *rframe, if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; + if (s->keyframe) { + rframe->pict_type = AV_PICTURE_TYPE_I; + rframe->flags |= AV_FRAME_FLAG_KEY; + } else { + rframe->pict_type = AV_PICTURE_TYPE_P; + rframe->flags &= ~AV_FRAME_FLAG_KEY; + } *got_frame = 1; return bytestream2_tell(&s->gb); |