]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
log statsistics headers whenever verbosity goes on or off or whenever statistics...
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sun, 28 Nov 2021 21:51:26 +0000 (21:51 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sun, 28 Nov 2021 21:51:26 +0000 (21:51 +0000)
dbus-service.c
player.h

index bbd5dcd45f0c54288da45a5f236eba632beabf7e..05dd97266f0c06dc423fb01cb20855cc590630bc 100644 (file)
@@ -423,6 +423,8 @@ gboolean notify_statistics_callback(ShairportSyncDiagnostics *skeleton,
   // debug(1, "\"notify_statistics_callback\" called.");
   if (shairport_sync_diagnostics_get_statistics(skeleton)) {
     debug(1, ">> start logging statistics");
+    if (config.statistics_requested == 0)
+      statistics_row = 0; // redraw the header line
     config.statistics_requested = 1;
   } else {
     debug(1, ">> stop logging statistics");
@@ -437,6 +439,8 @@ gboolean notify_verbosity_callback(ShairportSyncDiagnostics *skeleton,
   if ((th >= 0) && (th <= 3)) {
     if (th == 0)
       debug(1, ">> log verbosity set to %d.", th);
+    if (((debuglev == 0) && (th != 0)) || ((debuglev != 0) && (th == 0)))
+      statistics_row = 0; // if the debug level changes, redraw the header line
     debuglev = th;
     debug(1, ">> log verbosity set to %d.", th);
   } else {
index d37f00c7604414b733c63eff2d33653eb5df7e0d..edf80837755d872ccafc9aea82dc580096054413 100644 (file)
--- a/player.h
+++ b/player.h
@@ -410,6 +410,7 @@ typedef struct {
 } rtsp_conn_info;
 
 extern pthread_mutex_t playing_conn_lock;
+extern int statistics_row; // will be reset to zero when debug level changes or statistics enabled
 
 void reset_buffer(rtsp_conn_info *conn);