From 0a12e69024871f0d6e735a6114fcb69e5cac5960 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 23 Feb 2010 17:19:14 +0100 Subject: [PATCH] rtpjitterbuffer: Return 100 if high-level is 0 instead of dividing by zero --- gst/rtpmanager/rtpjitterbuffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/rtpmanager/rtpjitterbuffer.c b/gst/rtpmanager/rtpjitterbuffer.c index 6601f50..bf60127 100644 --- a/gst/rtpmanager/rtpjitterbuffer.c +++ b/gst/rtpmanager/rtpjitterbuffer.c @@ -763,6 +763,9 @@ rtp_jitter_buffer_get_percent (RTPJitterBuffer * jbuf) gint percent; guint64 level; + if (G_UNLIKELY (jbuf->high_level == 0)) + return 100; + level = get_buffer_level (jbuf); percent = (level * 100 / jbuf->high_level); percent = MIN (percent, 100); -- 2.7.4