aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dls.cpp1
-rw-r--r--src/dls.h1
-rw-r--r--src/odr-padenc.cpp17
3 files changed, 19 insertions, 0 deletions
diff --git a/src/dls.cpp b/src/dls.cpp
index e5f6f27..74b1131 100644
--- a/src/dls.cpp
+++ b/src/dls.cpp
@@ -38,6 +38,7 @@ const std::string DLSEncoder::DL_PARAMS_OPEN = "##### parameters { #####";
const std::string DLSEncoder::DL_PARAMS_CLOSE = "##### parameters } #####";
const int DLSEncoder::APPTYPE_START = 2;
const int DLSEncoder::APPTYPE_CONT = 3;
+const std::string DLSEncoder::REQUEST_REREAD_SUFFIX = ".REQUEST_DLS_REREAD";
diff --git a/src/dls.h b/src/dls.h
index 84ff4c5..3b7387d 100644
--- a/src/dls.h
+++ b/src/dls.h
@@ -151,6 +151,7 @@ private:
public:
static const int APPTYPE_START;
static const int APPTYPE_CONT;
+ static const std::string REQUEST_REREAD_SUFFIX;
DLSEncoder(PADPacketizer* pad_packetizer) : pad_packetizer(pad_packetizer), dls_toggle(false) {}
void encodeLabel(const std::string& dls_file, const DL_PARAMS& dl_params);
diff --git a/src/odr-padenc.cpp b/src/odr-padenc.cpp
index 379791d..e065755 100644
--- a/src/odr-padenc.cpp
+++ b/src/odr-padenc.cpp
@@ -522,6 +522,23 @@ int UniformPadEncoder::Encode() {
// handle DLS
if (options.DLSEnabled()) {
+ // check for DLS re-read request
+ for (size_t i = 0; i < options.dls_files.size(); i++) {
+ int reread = CheckRereadFile("DLS file '" + options.dls_files[i] + "'", options.dls_files[i] + DLSEncoder::REQUEST_REREAD_SUFFIX);
+ switch (reread) {
+ case 1: // re-read requested
+ // switch to desired DLS file
+ curr_dls_file = i;
+ next_label = pad_timeline + std::chrono::seconds(options.label_interval);
+
+ // enforce label insertion
+ next_label_insertion = pad_timeline;
+ break;
+ case -1: // error
+ return 1;
+ }
+ }
+
if (options.dls_files.size() > 1 && pad_timeline >= next_label) {
// switch to next DLS file
curr_dls_file = (curr_dls_file + 1) % options.dls_files.size();