X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcuviddec.c;h=4d3caf924ed3aea1951c810a15ca22d36d510421;hb=26892c7615395f331f6143535f03a2957973e2e0;hp=122c28f6e87efb07542ecfe7037aa6dcb6cf111c;hpb=b855b570c811d208bfadeb4e140bee90c1598e72;p=ffmpeg diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index 122c28f6e87..4d3caf924ed 100644 --- a/libavcodec/cuviddec.c +++ b/libavcodec/cuviddec.c @@ -550,12 +550,16 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame) .Height = avctx->height >> (i ? 1 : 0), }; - ret = CHECK_CU(ctx->cudl->cuMemcpy2D(&cpy)); + ret = CHECK_CU(ctx->cudl->cuMemcpy2DAsync(&cpy, device_hwctx->stream)); if (ret < 0) goto error; offset += avctx->height; } + + ret = CHECK_CU(ctx->cudl->cuStreamSynchronize(device_hwctx->stream)); + if (ret < 0) + goto error; } else if (avctx->pix_fmt == AV_PIX_FMT_NV12 || avctx->pix_fmt == AV_PIX_FMT_P010 || avctx->pix_fmt == AV_PIX_FMT_P016) {