From cef3e6facc28bd08c170d26240295abbc3658170 Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Tue, 14 Jul 2015 21:34:08 +0200 Subject: MOT encoder: better queue type for PAD packetizer --- src/mot-encoder.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mot-encoder.cpp b/src/mot-encoder.cpp index ae0d556..c3c82b5 100644 --- a/src/mot-encoder.cpp +++ b/src/mot-encoder.cpp @@ -349,7 +349,7 @@ private: void ResetPAD(); pad_t* FlushPAD(); public: - std::vector queue; + std::deque queue; PADPacketizer(size_t pad_size); ~PADPacketizer(); @@ -374,8 +374,8 @@ PADPacketizer::PADPacketizer(size_t pad_size) : PADPacketizer::~PADPacketizer() { while (!queue.empty()) { - delete queue.back(); - queue.pop_back(); + delete queue.front(); + queue.pop_front(); } } @@ -393,7 +393,7 @@ pad_t* PADPacketizer::GetPAD() { if (dg->Available() == 0) { delete dg; - queue.erase(queue.begin()); + queue.pop_front(); } } @@ -529,7 +529,7 @@ pad_t* PADPacketizer::FlushPAD() { pad_t* result = new pad_t(xpad_size_max + FPAD_LEN + 1); pad_t &pad = *result; - size_t pad_offset = pad.size() - 1 - FPAD_LEN; + size_t pad_offset = xpad_size_max; if (subfields_size > 0) { if (used_cis > 0) { -- cgit v1.2.3