|
|
@ -113,7 +113,7 @@ static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* check if picture layout was changed and reallocate buffers */ |
|
|
|
/* check if picture layout was changed and reallocate buffers */ |
|
|
|
if (ivi_pic_config_cmp(&pic_conf, &ctx->pic_conf)) { |
|
|
|
if (ivi_pic_config_cmp(&pic_conf, &ctx->pic_conf) || ctx->gop_invalid) { |
|
|
|
result = ff_ivi_init_planes(ctx->planes, &pic_conf); |
|
|
|
result = ff_ivi_init_planes(ctx->planes, &pic_conf); |
|
|
|
if (result < 0) { |
|
|
|
if (result < 0) { |
|
|
|
av_log(avctx, AV_LOG_ERROR, "Couldn't reallocate color planes!\n"); |
|
|
|
av_log(avctx, AV_LOG_ERROR, "Couldn't reallocate color planes!\n"); |
|
|
@ -314,9 +314,9 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx) |
|
|
|
ctx->frame_num = get_bits(&ctx->gb, 8); |
|
|
|
ctx->frame_num = get_bits(&ctx->gb, 8); |
|
|
|
|
|
|
|
|
|
|
|
if (ctx->frame_type == FRAMETYPE_INTRA) { |
|
|
|
if (ctx->frame_type == FRAMETYPE_INTRA) { |
|
|
|
ctx->gop_invalid = 1; |
|
|
|
|
|
|
|
if ((ret = decode_gop_header(ctx, avctx)) < 0) { |
|
|
|
if ((ret = decode_gop_header(ctx, avctx)) < 0) { |
|
|
|
av_log(avctx, AV_LOG_ERROR, "Invalid GOP header, skipping frames.\n"); |
|
|
|
av_log(avctx, AV_LOG_ERROR, "Invalid GOP header, skipping frames.\n"); |
|
|
|
|
|
|
|
ctx->gop_invalid = 1; |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
ctx->gop_invalid = 0; |
|
|
|
ctx->gop_invalid = 0; |
|
|
|