Should fix ticket #9180
Unified · Split
| @@ -161,6 +161,7 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame, · 160 unmodified lines | ||
| 161 | 161 | AVFrame *picture = data; |
| 162 | 162 | const void *iter = NULL; |
| 163 | 163 | struct aom_image *img; |
| 164 | + aom_codec_frame_flags_t av_unused flags; | |
| 164 | 165 | int ret; |
| 165 | 166 | |
| 166 | 167 | if (aom_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL) != |
| @@ -198,6 +199,19 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame, · 31 unmodified lines | ||
| 198 | 199 | if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) |
| 199 | 200 | return ret; |
| 200 | 201 | |
| 202 | +#ifdef AOM_CTRL_AOMD_GET_FRAME_FLAGS | |
| 203 | + ret = aom_codec_control(&ctx->decoder, AOMD_GET_FRAME_FLAGS, &flags); | |
| 204 | + if (ret == AOM_CODEC_OK) { | |
| 205 | + picture->key_frame = !!(flags & AOM_FRAME_IS_KEY); | |
| 206 | + if (flags & (AOM_FRAME_IS_KEY | AOM_FRAME_IS_INTRAONLY)) | |
| 207 | + picture->pict_type = AV_PICTURE_TYPE_I; | |
| 208 | + else if (flags & AOM_FRAME_IS_SWITCH) | |
| 209 | + picture->pict_type = AV_PICTURE_TYPE_SP; | |
| 210 | + else | |
| 211 | + picture->pict_type = AV_PICTURE_TYPE_P; | |
| 212 | + } | |
| 213 | +#endif | |
| 214 | + | |
| 201 | 215 | av_reduce(&picture->sample_aspect_ratio.num, |
| 202 | 216 | &picture->sample_aspect_ratio.den, |
| 203 | 217 | picture->height * img->r_w, |