mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
nvdec: Skip draining before creating internal parser
GstVideoDecoder::drain/flush can be called at very initial state with stream-start and flush-stop event, respectively. Draning with NULL CUvideoparser seems to unsafe and that eventually failed to handle it.
This commit is contained in:
parent
71d9e33085
commit
c8640e23f4
1 changed files with 2 additions and 2 deletions
|
@ -812,7 +812,7 @@ gst_nvdec_flush (GstVideoDecoder * decoder)
|
|||
|
||||
nvdec->state = GST_NVDEC_STATE_PARSE;
|
||||
|
||||
if (!cuda_OK (CuvidParseVideoData (nvdec->parser, &packet)))
|
||||
if (nvdec->parser && !cuda_OK (CuvidParseVideoData (nvdec->parser, &packet)))
|
||||
GST_WARNING_OBJECT (nvdec, "parser failed");
|
||||
|
||||
return TRUE;
|
||||
|
@ -830,7 +830,7 @@ gst_nvdec_drain (GstVideoDecoder * decoder)
|
|||
packet.payload = NULL;
|
||||
packet.flags = CUVID_PKT_ENDOFSTREAM;
|
||||
|
||||
if (!cuda_OK (CuvidParseVideoData (nvdec->parser, &packet)))
|
||||
if (nvdec->parser && !cuda_OK (CuvidParseVideoData (nvdec->parser, &packet)))
|
||||
GST_WARNING_OBJECT (nvdec, "parser failed");
|
||||
|
||||
return nvdec->last_ret;
|
||||
|
|
Loading…
Reference in a new issue