lavc/libaomdec: fix build with 1.0.0
aom_codec_frame_flags_t in libaom 1.0.0 is defined in aom_encoder.h, whereas for newer versions it was moved to aom_codec.h
This commit is contained in:
parent
0c7aef84a0
commit
d43b26b30d
@ -161,7 +161,6 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
AVFrame *picture = data;
|
AVFrame *picture = data;
|
||||||
const void *iter = NULL;
|
const void *iter = NULL;
|
||||||
struct aom_image *img;
|
struct aom_image *img;
|
||||||
aom_codec_frame_flags_t av_unused flags;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (aom_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL) !=
|
if (aom_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL) !=
|
||||||
@ -200,15 +199,18 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#ifdef AOM_CTRL_AOMD_GET_FRAME_FLAGS
|
#ifdef AOM_CTRL_AOMD_GET_FRAME_FLAGS
|
||||||
ret = aom_codec_control(&ctx->decoder, AOMD_GET_FRAME_FLAGS, &flags);
|
{
|
||||||
if (ret == AOM_CODEC_OK) {
|
aom_codec_frame_flags_t flags;
|
||||||
picture->key_frame = !!(flags & AOM_FRAME_IS_KEY);
|
ret = aom_codec_control(&ctx->decoder, AOMD_GET_FRAME_FLAGS, &flags);
|
||||||
if (flags & (AOM_FRAME_IS_KEY | AOM_FRAME_IS_INTRAONLY))
|
if (ret == AOM_CODEC_OK) {
|
||||||
picture->pict_type = AV_PICTURE_TYPE_I;
|
picture->key_frame = !!(flags & AOM_FRAME_IS_KEY);
|
||||||
else if (flags & AOM_FRAME_IS_SWITCH)
|
if (flags & (AOM_FRAME_IS_KEY | AOM_FRAME_IS_INTRAONLY))
|
||||||
picture->pict_type = AV_PICTURE_TYPE_SP;
|
picture->pict_type = AV_PICTURE_TYPE_I;
|
||||||
else
|
else if (flags & AOM_FRAME_IS_SWITCH)
|
||||||
picture->pict_type = AV_PICTURE_TYPE_P;
|
picture->pict_type = AV_PICTURE_TYPE_SP;
|
||||||
|
else
|
||||||
|
picture->pict_type = AV_PICTURE_TYPE_P;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user