aboutsummaryrefslogtreecommitdiffstats
path: root/src/odr-audioenc.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-04-22 18:01:44 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-04-22 18:01:44 +0200
commitc215e558f4b4e4137ed2c62706bf7fb95230e5c1 (patch)
tree10633e60a69a10b2a9b0aad25a05f8c18e12e56a /src/odr-audioenc.cpp
parent467c3ac4015752f748db27f4a6dc16a3abac784c (diff)
downloadODR-AudioEnc-c215e558f4b4e4137ed2c62706bf7fb95230e5c1.tar.gz
ODR-AudioEnc-c215e558f4b4e4137ed2c62706bf7fb95230e5c1.tar.bz2
ODR-AudioEnc-c215e558f4b4e4137ed2c62706bf7fb95230e5c1.zip
Only write ICY Text if it changed
Diffstat (limited to 'src/odr-audioenc.cpp')
-rw-r--r--src/odr-audioenc.cpp5
1 files changed, 4 insertions, 1 deletions
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