You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/cuvid: Fully re-initialize the parser after a flush.
I'm not really sure how this worked at all before, but we do need to reinitalize the parser with the stream extradata. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
committed by
Timo Rothenpieler
parent
4096bb176b
commit
8a06669702
@@ -706,6 +706,7 @@ static void cuvid_flush(AVCodecContext *avctx)
|
|||||||
AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)ctx->hwdevice->data;
|
AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)ctx->hwdevice->data;
|
||||||
AVCUDADeviceContext *device_hwctx = device_ctx->hwctx;
|
AVCUDADeviceContext *device_hwctx = device_ctx->hwctx;
|
||||||
CUcontext dummy, cuda_ctx = device_hwctx->cuda_ctx;
|
CUcontext dummy, cuda_ctx = device_hwctx->cuda_ctx;
|
||||||
|
CUVIDSOURCEDATAPACKET seq_pkt = { 0 };
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ctx->ever_flushed = 1;
|
ctx->ever_flushed = 1;
|
||||||
@@ -736,6 +737,15 @@ static void cuvid_flush(AVCodecContext *avctx)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
seq_pkt.payload = ctx->cuparse_ext.raw_seqhdr_data;
|
||||||
|
seq_pkt.payload_size = ctx->cuparse_ext.format.seqhdr_data_length;
|
||||||
|
|
||||||
|
if (seq_pkt.payload && seq_pkt.payload_size) {
|
||||||
|
ret = CHECK_CU(cuvidParseVideoData(ctx->cuparser, &seq_pkt));
|
||||||
|
if (ret < 0)
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
ret = CHECK_CU(cuCtxPopCurrent(&dummy));
|
ret = CHECK_CU(cuCtxPopCurrent(&dummy));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
Reference in New Issue
Block a user