From: Sebastian Dröge Date: Tue, 23 Feb 2010 16:19:14 +0000 (+0100) Subject: rtpjitterbuffer: Return 100 if high-level is 0 instead of dividing by zero X-Git-Tag: RELEASE-0.10.19~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a12e69024871f0d6e735a6114fcb69e5cac5960;p=platform%2Fupstream%2Fgst-plugins-good.git rtpjitterbuffer: Return 100 if high-level is 0 instead of dividing by zero --- 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);