nvdec: Do not map GStreamer discont to CUVid discont

Setting the CUVID_PKT_DISCONTINUITY implies clearing any past information
about the stream in the decoder. The GStreamer discont flag is used for
discontinuity caused by a seek, for first buffer and if a buffer was
dropped. In the first two cases, the parsers and demuxers should ensure we
start from a synchronization point, so it's unlikely that delta will be
matched against the wrong state.

For packet lost, the discontinuity flag will prevent the decoder from doing
any concealment, with a result that ca be much worst visually, or freeze the
playback until an IDR is met. It's better to let the decoder handle that for
us.

Removing this flag, also workaround a but in NVidia parser that makes it
ignore our ENDOFFRAME flag and increase the latency by one frame.
This commit is contained in:
Nicolas Dufresne 2020-01-23 11:01:33 -05:00 committed by GStreamer Merge Bot
parent a28ce16b3f
commit d393232bc2

View file

@ -1116,7 +1116,6 @@ gst_nvdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
in_buffer = gst_buffer_ref (frame->input_buffer);
if (GST_BUFFER_IS_DISCONT (frame->input_buffer)) {
packet.flags = CUVID_PKT_DISCONTINUITY;
if (nvdec->codec_data && klass->codec_type == cudaVideoCodec_MPEG4) {
in_buffer = gst_buffer_append (gst_buffer_ref (nvdec->codec_data),
in_buffer);