Commit 7e78801f authored by Haihao Xiang's avatar Haihao Xiang Committed by Mark Thompson

vaapi_encode: Add an assert in vaapi_encode_truncate_gop()

The flag of input_available must be set when pic_start is not NULL, so
add an assert to ensure it is true. In addition, the assert on last_pic
is unnecessary now, so remove this assert.
Signed-off-by: 's avatarHaihao Xiang <haihao.xiang@intel.com>
parent 12610037
...@@ -762,6 +762,8 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx) ...@@ -762,6 +762,8 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx)
VAAPIEncodeContext *ctx = avctx->priv_data; VAAPIEncodeContext *ctx = avctx->priv_data;
VAAPIEncodePicture *pic, *last_pic, *next; VAAPIEncodePicture *pic, *last_pic, *next;
av_assert0(!ctx->pic_start || ctx->pic_start->input_available);
// Find the last picture we actually have input for. // Find the last picture we actually have input for.
for (pic = ctx->pic_start; pic; pic = pic->next) { for (pic = ctx->pic_start; pic; pic = pic->next) {
if (!pic->input_available) if (!pic->input_available)
...@@ -770,8 +772,6 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx) ...@@ -770,8 +772,6 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx)
} }
if (pic) { if (pic) {
av_assert0(last_pic);
if (last_pic->type == PICTURE_TYPE_B) { if (last_pic->type == PICTURE_TYPE_B) {
// Some fixing up is required. Change the type of this // Some fixing up is required. Change the type of this
// picture to P, then modify preceding B references which // picture to P, then modify preceding B references which
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment