nvdec: Fix timestamp mismatch on draining frames

The internal decoding state must be GST_NVDEC_STATE_PARSE before
calling CuvidParseVideoData(). Otherwise, nvdec will be confused
on decode callback as if the frame is decoding only frame and
the input timestamp of corresponding frame will be ignored.
Eventually one decoded frame will have non-increased PTS.
This commit is contained in:
Seungha Yang 2019-08-18 15:45:37 +09:00
parent a427b36f79
commit f7b2b1b99d

View file

@ -1039,6 +1039,8 @@ gst_nvdec_drain (GstVideoDecoder * decoder)
packet.payload = NULL; packet.payload = NULL;
packet.flags = CUVID_PKT_ENDOFSTREAM; packet.flags = CUVID_PKT_ENDOFSTREAM;
nvdec->state = GST_NVDEC_STATE_PARSE;
if (nvdec->parser if (nvdec->parser
&& !gst_cuda_result (CuvidParseVideoData (nvdec->parser, &packet))) && !gst_cuda_result (CuvidParseVideoData (nvdec->parser, &packet)))
GST_WARNING_OBJECT (nvdec, "parser failed"); GST_WARNING_OBJECT (nvdec, "parser failed");