aboutsummaryrefslogtreecommitdiffstats
path: root/src/pad_common.cpp
diff options
context:
space:
mode:
authorStefan Pöschel <spoeschel@irt.de>2017-02-06 23:56:42 +0100
committerStefan Pöschel <spoeschel@irt.de>2017-02-06 23:56:42 +0100
commit222e277c57769486800a43bc758175567231db40 (patch)
treeea9e8d67e2db38023238caed3058e5e5b6ccb24f /src/pad_common.cpp
parent0f3a52cbc8abde43ef6ed584eb2403960d994fc1 (diff)
downloadODR-PadEnc-222e277c57769486800a43bc758175567231db40.tar.gz
ODR-PadEnc-222e277c57769486800a43bc758175567231db40.tar.bz2
ODR-PadEnc-222e277c57769486800a43bc758175567231db40.zip
PAD: insert DLS regularly while SLS transmission
When a slide is transmitted, now every 50 PADs the current DLS is inserted (and thereby reread from file). Hence in the best case (AAC-LC @ 48 kHz), DLS is inserted every 1000ms; in the worst case (HE-AAC @ 32 kHz) it is inserted every 3000ms. This way a listener will get DLS much earlier after switching to a service, compared to the previous situation where the slide transmission was not interrupted for DLS insertion. Note that there still remains a delay without any PAD, between the end of a slide transmission and the start of the next one's transmission. Also note that adding a feedback channel from the audio encoder to ODR-PadEnc will make this improvement obsolete.
Diffstat (limited to 'src/pad_common.cpp')
-rw-r--r--src/pad_common.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/pad_common.cpp b/src/pad_common.cpp
index 450b122..7cc422d 100644
--- a/src/pad_common.cpp
+++ b/src/pad_common.cpp
@@ -99,11 +99,15 @@ PADPacketizer::~PADPacketizer() {
}
void PADPacketizer::AddDG(DATA_GROUP* dg, bool prepend) {
- queue.insert(prepend ? queue.begin() : queue.end(), dg);
+ queue.insert(prepend ? queue.begin() : queue.end(), dg);
}
void PADPacketizer::AddDGs(const std::vector<DATA_GROUP*>& dgs, bool prepend) {
- queue.insert(prepend ? queue.begin() : queue.end(), dgs.cbegin(), dgs.cend());
+ queue.insert(prepend ? queue.begin() : queue.end(), dgs.cbegin(), dgs.cend());
+}
+
+bool PADPacketizer::QueueFilled() {
+ return !queue.empty();
}
pad_t* PADPacketizer::GetPAD() {
@@ -127,8 +131,9 @@ pad_t* PADPacketizer::GetPAD() {
return FlushPAD();
}
-void PADPacketizer::WriteAllPADs(int output_fd) {
- for (;;) {
+void PADPacketizer::WriteAllPADs(int output_fd, int limit) {
+ // output a limited amount of PADs (-1 = no limit)
+ for (int i = 0; i != limit; i++) {
pad_t* pad = GetPAD();
// if only F-PAD present, abort