summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode.c
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2018-05-10 11:08:22 +0800
committerMark Thompson <sw@jkqxz.net>2018-05-10 19:52:53 +0100
commit7e78801fa5802dd49712d2b1fdb8bb31d8373ecc (patch)
treede0b0cfd48cd765b8f324e669665a0c6bbcffa9f /libavcodec/vaapi_encode.c
parent1261003700322789d62a892e3325f8b58349d051 (diff)
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: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavcodec/vaapi_encode.c')
-rw-r--r--libavcodec/vaapi_encode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 36c85a3815..910fd1b365 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -762,6 +762,8 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx)
VAAPIEncodeContext *ctx = avctx->priv_data;
VAAPIEncodePicture *pic, *last_pic, *next;
+ av_assert0(!ctx->pic_start || ctx->pic_start->input_available);
+
// Find the last picture we actually have input for.
for (pic = ctx->pic_start; pic; pic = pic->next) {
if (!pic->input_available)
@@ -770,8 +772,6 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx)
}
if (pic) {
- av_assert0(last_pic);
-
if (last_pic->type == PICTURE_TYPE_B) {
// Some fixing up is required. Change the type of this
// picture to P, then modify preceding B references which