From c215e558f4b4e4137ed2c62706bf7fb95230e5c1 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 22 Apr 2020 18:01:44 +0200 Subject: Only write ICY Text if it changed --- src/odr-audioenc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp index 94f5678..acc9295 100644 --- a/src/odr-audioenc.cpp +++ b/src/odr-audioenc.cpp @@ -407,6 +407,7 @@ public: string icytext_file; bool icytext_dlplus = false; + ICY_TEXT_t previous_text; // For the ALSA input string alsa_device; @@ -1003,13 +1004,15 @@ int AudioEnc::run() } #endif - if (text) { + if (previous_text != text) { bool success = write_icy_to_file(text, icytext_file, icytext_dlplus); if (not success) { fprintf(stderr, "Failed to write ICY Text\n"); } } + + previous_text = text; } /*! \section AudioLevel -- cgit v1.2.3