Blame SOURCES/0019-sink_event_probe-do-not-keep-duration-in-a-variable.patch

76100f
From bb4999f6e450aa1b1270ade7113966869fc4ed27 Mon Sep 17 00:00:00 2001
76100f
From: Uri Lublin <uril@redhat.com>
76100f
Date: Wed, 11 Nov 2020 20:34:09 +0200
76100f
Subject: [PATCH 19/22] sink_event_probe: do not keep duration in a variable
76100f
76100f
If not ENABLE_RECORDER, then duration is assigned a value
76100f
but is never used - as the compiler optimizes it out.
76100f
76100f
Fixes the following clang warning:
76100f
  src/channel-display-gst.c:443:21: warning: Value stored to
76100f
  'duration' during its initialization is never read
76100f
76100f
Signed-off-by: Uri Lublin <uril@redhat.com>
76100f
---
76100f
 src/channel-display-gst.c | 4 ++--
76100f
 1 file changed, 2 insertions(+), 2 deletions(-)
76100f
76100f
diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
76100f
index c58a90f..36db3a3 100644
76100f
--- a/src/channel-display-gst.c
76100f
+++ b/src/channel-display-gst.c
76100f
@@ -439,7 +439,6 @@ sink_event_probe(GstPad *pad, GstPadProbeInfo *info, gpointer data)
76100f
         if (l) {
76100f
             SpiceGstFrame *gstframe = l->data;
76100f
             const SpiceFrame *frame = gstframe->encoded_frame;
76100f
-            int64_t duration = g_get_monotonic_time() - frame->creation_time;
76100f
             /* Note that queue_len (the length of the queue prior to adding
76100f
              * this frame) is crucial to correctly interpret the decoding time:
76100f
              * - Less than MAX_DECODED_FRAMES means nothing blocked the
76100f
@@ -450,7 +449,8 @@ sink_event_probe(GstPad *pad, GstPadProbeInfo *info, gpointer data)
76100f
             record(frames_stats,
76100f
                    "frame mm_time %u size %u creation time %" PRId64
76100f
                    " decoded time %" PRId64 " queue %u before %u",
76100f
-                   frame->mm_time, frame->size, frame->creation_time, duration,
76100f
+                   frame->mm_time, frame->size, frame->creation_time,
76100f
+                   g_get_monotonic_time() - frame->creation_time,
76100f
                    decoder->decoding_queue->length, gstframe->queue_len);
76100f
 
76100f
             if (!decoder->appsink) {
76100f
-- 
76100f
2.28.0
76100f