rtpstorage: Issue warning if request by size if 0
authorOlivier Crête <olivier.crete@collabora.com>
Thu, 21 Mar 2019 21:32:18 +0000 (17:32 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Tue, 26 Mar 2019 23:41:06 +0000 (19:41 -0400)
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

index f96667e6500d3c879ce2d0c8bc7b3468e8ae436d..ecabffced657eefc746d370b3e9853df5259ee52 100644 (file)
@@ -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);