From 222e277c57769486800a43bc758175567231db40 Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Mon, 6 Feb 2017 23:56:42 +0100 Subject: 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. --- src/pad_common.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/pad_common.cpp') 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& 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 -- cgit v1.2.3