History

lavc/vaapi_encode: Init pic at the beginning of API

Fei Wang committed 3 years ago

Commit 4a440071 parent 695477a1 file · +1 −4Browse files

Unified · Split

libavcodec/vaapi_encode.c+1−4
@@ -1205,7 +1205,7 @@ fail: · 1204 unmodified lines
12051205 int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
12061206 {
12071207 VAAPIEncodeContext *ctx = avctx->priv_data;
1208− VAAPIEncodePicture *pic;
1208+ VAAPIEncodePicture *pic = NULL;
12091209 AVFrame *frame = ctx->frame;
12101210 int err;
12111211
@@ -1228,8 +1228,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) · 16 unmodified lines
12281228 }
12291229
12301230 if (ctx->has_sync_buffer_func) {
1231− pic = NULL;
1232−
12331231 if (av_fifo_can_write(ctx->encode_fifo)) {
12341232 err = vaapi_encode_pick_next(avctx, &pic);
12351233 if (!err) {
@@ -1255,7 +1253,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) · 19 unmodified lines
12551253 av_fifo_read(ctx->encode_fifo, &pic, 1);
12561254 ctx->encode_order = pic->encode_order + 1;
12571255 } else {
1258− pic = NULL;
12591256 err = vaapi_encode_pick_next(avctx, &pic);
12601257 if (err < 0)
12611258 return err;

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