From 89c592ccdd37136232b32bca66c5a80eba24f288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 10 Feb 2014 18:21:38 +0100 Subject: [PATCH] hlsdemux: Fix bitrate calculation g_get_monotonic_time() returns microseconds, not nanoseconds. --- ext/hls/gsthlsdemux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c index 96dcc7ff1d..6dce5e5cbd 100644 --- a/ext/hls/gsthlsdemux.c +++ b/ext/hls/gsthlsdemux.c @@ -1227,7 +1227,7 @@ gst_hls_demux_switch_playlist (GstHLSDemux * demux) diff = g_get_monotonic_time () - demux->next_update; buffer = gst_fragment_get_buffer (fragment); size = gst_buffer_get_size (buffer); - bitrate = (size * 8) / ((double) diff / GST_SECOND); + bitrate = (size * 8) / ((double) diff / G_USEC_PER_SEC); GST_DEBUG ("Downloaded %d bytes in %" GST_TIME_FORMAT ". Bitrate is : %d", (guint) size, GST_TIME_ARGS (diff), bitrate);