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.
This commit is contained in:
Olivier Crête 2019-03-21 17:32:18 -04:00
parent 7a317ff732
commit c840328664

View file

@ -80,6 +80,13 @@ rtp_storage_get_packets_for_recovery (RtpStorage * self, gint fec_pt,
GstBufferList *ret = NULL; GstBufferList *ret = NULL;
RtpStorageStream *stream; 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); STORAGE_LOCK (self);
stream = g_hash_table_lookup (self->streams, GUINT_TO_POINTER (ssrc)); stream = g_hash_table_lookup (self->streams, GUINT_TO_POINTER (ssrc));
STORAGE_UNLOCK (self); STORAGE_UNLOCK (self);
@ -110,6 +117,12 @@ rtp_storage_get_redundant_packet (RtpStorage * self, guint32 ssrc,
GstBuffer *ret = NULL; GstBuffer *ret = NULL;
RtpStorageStream *stream; 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); STORAGE_LOCK (self);
stream = g_hash_table_lookup (self->streams, GUINT_TO_POINTER (ssrc)); stream = g_hash_table_lookup (self->streams, GUINT_TO_POINTER (ssrc));
STORAGE_UNLOCK (self); STORAGE_UNLOCK (self);