mssdemux: Avoid a possible division by zero
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>
Tue, 5 Feb 2013 05:27:51 +0000 (03:27 -0200)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 8 May 2013 00:09:48 +0000 (21:09 -0300)
ext/smoothstreaming/gstmssdemux.c

index d5558c1..a87418e 100644 (file)
@@ -1140,8 +1140,8 @@ gst_mss_demux_stream_download_fragment (GstMssDemuxStream * stream,
 
   after_download = g_get_real_time ();
   if (_buffer) {
-    guint64 bitrate = 8 * GST_BUFFER_SIZE (_buffer) /
-        ((after_download - before_download) / 1000000ULL);
+    guint64 bitrate = (8 * GST_BUFFER_SIZE (_buffer) * 1000000LLU) /
+        (after_download - before_download);
 
     GST_DEBUG_OBJECT (mssdemux, "Measured download bitrate: %s %llu bps",
         GST_PAD_NAME (stream->pad), bitrate);