diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 8b33826..5055360 100644
|
a
|
b
|
typedef struct PNGDecContext {
|
| 52 | 52 | int channels; |
| 53 | 53 | int bits_per_pixel; |
| 54 | 54 | int bpp; |
| | 55 | int has_keyframes; |
| 55 | 56 | |
| 56 | 57 | uint8_t *image_buf; |
| 57 | 58 | int image_linesize; |
| … |
… |
static int decode_frame(AVCodecContext *avctx,
|
| 819 | 820 | } |
| 820 | 821 | } |
| 821 | 822 | |
| 822 | | /* handle p-frames only if a predecessor frame is available */ |
| 823 | | if (s->prev->data[0]) { |
| | 823 | if (avpkt->flags & AV_PKT_FLAG_KEY) { |
| | 824 | s->has_keyframes = 1; |
| | 825 | } |
| | 826 | |
| | 827 | /* handle p-frames only if a predecessor frame is available |
| | 828 | and keyframes are indicated */ |
| | 829 | if (s->prev->data[0] && s->has_keyframes) { |
| 824 | 830 | if ( !(avpkt->flags & AV_PKT_FLAG_KEY) |
| 825 | 831 | && s->prev->width == p->width |
| 826 | 832 | && s->prev->height== p->height |
| … |
… |
static av_cold int png_dec_init(AVCodecContext *avctx)
|
| 875 | 881 | |
| 876 | 882 | s->avctx = avctx; |
| 877 | 883 | |
| | 884 | s->has_keyframes = 0; |
| | 885 | |
| 878 | 886 | return 0; |
| 879 | 887 | } |
| 880 | 888 | |