Browse Source

linux-v4l2: Fix timeout logging

The timeout_usec variable is uint64_t, but the log format was set to %ld
(signed long int), so it would sometimes log a nonsensical value. Let's
use $PRIu64 instead, which should be equivalent to %llu (unsigned long
long int).

Fixes #5797.
Ryan Foster 3 years ago
parent
commit
a7d3df3763
1 changed files with 2 additions and 1 deletions
  1. 2 1
      plugins/linux-v4l2/v4l2-input.c

+ 2 - 1
plugins/linux-v4l2/v4l2-input.c

@@ -189,7 +189,8 @@ static void *v4l2_thread(void *vptr)
 	blog(LOG_DEBUG, "%s: framerate: %.2f fps", data->device_id, ffps);
 	/* Timeout set to 5 frame periods. */
 	timeout_usec = (1000000 * data->timeout_frames) / ffps;
-	blog(LOG_INFO, "%s: select timeout set to %ldus (%dx frame periods)",
+	blog(LOG_INFO,
+	     "%s: select timeout set to %" PRIu64 " (%dx frame periods)",
 	     data->device_id, timeout_usec, data->timeout_frames);
 
 	if (v4l2_start_capture(data->dev, &data->buffers) < 0)