From 6f6c0cbbaff98d8f0cc0873dfe29cbb56c190abd Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 6 Jan 2023 00:14:27 +1100 Subject: [PATCH] adaptivedemux2: Log request duration in debug output When completing, log how long a HTTP request took into the debug output. Part-of: --- .../ext/adaptivedemux2/downloadhelper.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c index 3ef1cae824..962de66c30 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c @@ -349,10 +349,12 @@ on_read_ready (GObject * source, GAsyncResult * result, gpointer user_data) finish_transfer: if (request->in_use && !g_cancellable_is_cancelled (transfer->cancellable)) { SoupStatus status_code = _soup_message_get_status (transfer->msg); - - GST_LOG ("request complete. Code %d URI %s range %" G_GINT64_FORMAT " %" - G_GINT64_FORMAT, status_code, request->uri, - request->range_start, request->range_end); +#ifndef GST_DISABLE_GST_DEBUG + guint download_ms = (now - request->download_request_time) / GST_MSECOND; + GST_LOG ("request complete in %u ms. Code %d URI %s range %" G_GINT64_FORMAT + " %" G_GINT64_FORMAT, download_ms, status_code, + request->uri, request->range_start, request->range_end); +#endif if (request->state != DOWNLOAD_REQUEST_STATE_UNSENT) { if (SOUP_STATUS_IS_SUCCESSFUL (status_code)