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

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

Unified · Split

libavcodec/vaapi_encode.c+1−4
@@ -1205,7 +1205,7 @@ fail: · 1204 unmodified lines
1205int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)1205int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
1206{1206{
1207 VAAPIEncodeContext *ctx = avctx->priv_data;1207 VAAPIEncodeContext *ctx = avctx->priv_data;
1208 VAAPIEncodePicture *pic;1208 VAAPIEncodePicture *pic = NULL;
1209 AVFrame *frame = ctx->frame;1209 AVFrame *frame = ctx->frame;
1210 int err;1210 int err;
1211 1211
@@ -1228,8 +1228,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) · 16 unmodified lines
1228 }1228 }
1229 1229
1230 if (ctx->has_sync_buffer_func) {1230 if (ctx->has_sync_buffer_func) {
1231 pic = NULL;
1232
1233 if (av_fifo_can_write(ctx->encode_fifo)) {1231 if (av_fifo_can_write(ctx->encode_fifo)) {
1234 err = vaapi_encode_pick_next(avctx, &pic);1232 err = vaapi_encode_pick_next(avctx, &pic);
1235 if (!err) {1233 if (!err) {
@@ -1255,7 +1253,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) · 19 unmodified lines
1255 av_fifo_read(ctx->encode_fifo, &pic, 1);1253 av_fifo_read(ctx->encode_fifo, &pic, 1);
1256 ctx->encode_order = pic->encode_order + 1;1254 ctx->encode_order = pic->encode_order + 1;
1257 } else {1255 } else {
1258 pic = NULL;
1259 err = vaapi_encode_pick_next(avctx, &pic);1256 err = vaapi_encode_pick_next(avctx, &pic);
1260 if (err < 0)1257 if (err < 0)
1261 return err;1258 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