From c840328664da44b5fa78a39790d7282302549a9f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 21 Mar 2019 17:32:18 -0400 Subject: [PATCH] rtpstorage: Issue warning if request by size if 0 If the size is 0, then nothing will ever be in the storage, if a request is received, it generally implies a misconfigured pipeline. --- gst/rtp/rtpstorage.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst/rtp/rtpstorage.c b/gst/rtp/rtpstorage.c index f96667e65..ecabffced 100644 --- a/gst/rtp/rtpstorage.c +++ b/gst/rtp/rtpstorage.c @@ -80,6 +80,13 @@ rtp_storage_get_packets_for_recovery (RtpStorage * self, gint fec_pt, GstBufferList *ret = NULL; RtpStorageStream *stream; + if (0 == self->size_time) { + GST_WARNING_OBJECT (self, "Received request for recovery RTP packets" + " around lost_seqnum=%u fec_pt=%u for ssrc=%08x, but size is 0", + lost_seq, fec_pt, ssrc); + return NULL; + } + STORAGE_LOCK (self); stream = g_hash_table_lookup (self->streams, GUINT_TO_POINTER (ssrc)); STORAGE_UNLOCK (self); @@ -110,6 +117,12 @@ rtp_storage_get_redundant_packet (RtpStorage * self, guint32 ssrc, GstBuffer *ret = NULL; RtpStorageStream *stream; + if (0 == self->size_time) { + GST_WARNING_OBJECT (self, "Received request for redundant RTP packet with" + " seq=%u for ssrc=%08x, but size is 0", lost_seq, ssrc); + return NULL; + } + STORAGE_LOCK (self); stream = g_hash_table_lookup (self->streams, GUINT_TO_POINTER (ssrc)); STORAGE_UNLOCK (self); -- 2.34.1