diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index bf719b2..0eac775 100644
|
a
|
b
|
typedef struct PNGDecContext {
|
| 50 | 50 | int channels; |
| 51 | 51 | int bits_per_pixel; |
| 52 | 52 | int bpp; |
| | 53 | int has_keyframe; |
| 53 | 54 | |
| 54 | 55 | uint8_t *image_buf; |
| 55 | 56 | int image_linesize; |
| … |
… |
static int decode_frame(AVCodecContext *avctx,
|
| 589 | 590 | } |
| 590 | 591 | } |
| 591 | 592 | exit_loop: |
| 592 | | /* handle p-frames only if a predecessor frame is available */ |
| | 593 | /* handle p-frames only if a predecessor frame is available |
| | 594 | and keyframes have been indicated in the past */ |
| | 595 | |
| | 596 | if (avpkt->flags & PKT_FLAG_KEY) { |
| | 597 | s->has_keyframe = 1; |
| | 598 | } |
| | 599 | |
| 593 | 600 | if(s->last_picture->data[0] != NULL) { |
| 594 | | if(!(avpkt->flags & PKT_FLAG_KEY)) { |
| | 601 | if(!(avpkt->flags & PKT_FLAG_KEY) && s->has_keyframe) { |
| 595 | 602 | int i, j; |
| 596 | 603 | uint8_t *pd = s->current_picture->data[0]; |
| 597 | 604 | uint8_t *pd_last = s->last_picture->data[0]; |
| … |
… |
static av_cold int png_dec_init(AVCodecContext *avctx){
|
| 630 | 637 | avcodec_get_frame_defaults(&s->picture2); |
| 631 | 638 | dsputil_init(&s->dsp, avctx); |
| 632 | 639 | |
| | 640 | s->has_keyframe = 0; |
| | 641 | |
| 633 | 642 | return 0; |
| 634 | 643 | } |
| 635 | 644 | |