aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2018-05-08 13:56:51 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2018-05-10 00:34:22 +0200
commit93d1756af2908150f7c8c0590b9ed246951d474a (patch)
tree7bf1c16ccdb3ce8c3dea3041d26e1073481bb597
parent9b82e333b7c4235a3de7ce8d8fe115c53c11f50c (diff)
downloadffmpeg-93d1756af2908150f7c8c0590b9ed246951d474a.tar.gz
avcodec/cuviddec: explicitly synchronize cuMemcpy calls
-rw-r--r--libavcodec/cuviddec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 122c28f6e8..4d3caf924e 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) {