History

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.

Haihao Xiang committed 8 years ago

Commit 7e788011 parent 12610031 file · +2 −2Browse files

Showing the changes to libavcodec/vaapi_encode.c (1 of 1 file). Show all

Unified · Split

libavcodec/vaapi_encode.c+2−2
@@ -762,6 +762,8 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx) · 761 unmodified lines
762762 VAAPIEncodeContext *ctx = avctx->priv_data;
763763 VAAPIEncodePicture *pic, *last_pic, *next;
764764
765+ av_assert0(!ctx->pic_start || ctx->pic_start->input_available);
766+
765767 // Find the last picture we actually have input for.
766768 for (pic = ctx->pic_start; pic; pic = pic->next) {
767769 if (!pic->input_available)
@@ -770,8 +772,6 @@ static int vaapi_encode_truncate_gop(AVCodecContext *avctx) · 2 unmodified lines
770772 }
771773
772774 if (pic) {
773− av_assert0(last_pic);
774−
775775 if (last_pic->type == PICTURE_TYPE_B) {
776776 // Some fixing up is required. Change the type of this
777777 // picture to P, then modify preceding B references which

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t