aboutsummaryrefslogtreecommitdiffstats
path: root/src/mot-encoder.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-07-03 19:55:57 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-07-03 19:57:59 +0200
commite9d1d1e51c845d963178f6406e3bed36add69f94 (patch)
treecdd4b755e6343e8055014c66d77059d167e204c2 /src/mot-encoder.cpp
parent8909e09b49410a2c9e88ca3b180a3d9435386b3d (diff)
downloadfdk-aac-dabplus-e9d1d1e51c845d963178f6406e3bed36add69f94.tar.gz
fdk-aac-dabplus-e9d1d1e51c845d963178f6406e3bed36add69f94.tar.bz2
fdk-aac-dabplus-e9d1d1e51c845d963178f6406e3bed36add69f94.zip
mot-encoder Remove trailing line breaks from DLS
Diffstat (limited to 'src/mot-encoder.cpp')
-rw-r--r--src/mot-encoder.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mot-encoder.cpp b/src/mot-encoder.cpp
index 150d59c..ff577a6 100644
--- a/src/mot-encoder.cpp
+++ b/src/mot-encoder.cpp
@@ -530,6 +530,17 @@ void writeDLS(int output_fd, const char* dls_file, int padlen)
dlslen = read(dlsfd, dlstext, MAXDLS);
dlstext[dlslen] = 0x00;
+
+ // Remove trailing line breaks from the file
+ char* endp = dlstext + dlslen;
+ while ( endp > dlstext &&
+ (*endp == '\0' || *endp == '\n')) {
+ if (*endp == '\n') {
+ *endp == '\0';
+ }
+ endp--;
+ }
+
fprintf(stderr, "mot-encoder writing DLS text \"%s\"\n", dlstext);
create_dls_datagroup(dlstext, padlen);