From: Philippe Normand Date: Mon, 23 Dec 2024 08:49:51 +0000 (+0100) Subject: videodecoder: Gracefully handle missing data without prior input segment X-Git-Tag: 1.24.11~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38b5e3012b8150cbd4bd4c2bb96e169dfca3d33e;p=platform%2Fupstream%2Fgstreamer.git videodecoder: Gracefully handle missing data without prior input segment Exit early in case the decoder has been resetted and hasn't received a new segment event yet. This was detected with netsim dropping buffers in a WebRTC pipeline. Part-of: --- diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c index 92f45c23a9..a78b5fd40c 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c @@ -1307,14 +1307,19 @@ caps_error: } } +/* Must be called holding the GST_VIDEO_DECODER_STREAM_LOCK */ static gboolean -gst_video_decoder_handle_missing_data_default (GstVideoDecoder * - decoder, GstClockTime timestamp, GstClockTime duration) +gst_video_decoder_handle_missing_data_default (GstVideoDecoder * decoder, + GstClockTime timestamp, GstClockTime duration) { GstVideoDecoderPrivate *priv; priv = decoder->priv; + /* Exit early in case the decoder has been resetted and hasn't received a new segment event yet. */ + if (decoder->input_segment.format != GST_FORMAT_TIME) + return FALSE; + if (priv->automatic_request_sync_points) { GstClockTime deadline = gst_segment_to_running_time (&decoder->input_segment, GST_FORMAT_TIME,