diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-11-17 09:38:21 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-11-17 09:38:21 +0100 |
commit | c79009cef8db611f410f358a0556ec980db6b5e7 (patch) | |
tree | cf65ea5b4db2f988c196bca94a4b27b9c726345e /lib/edi/common.cpp | |
parent | 20e7c628347ec0e4a6469b53b98b5309c74a47f0 (diff) | |
download | dabmux-c79009cef8db611f410f358a0556ec980db6b5e7.tar.gz dabmux-c79009cef8db611f410f358a0556ec980db6b5e7.tar.bz2 dabmux-c79009cef8db611f410f358a0556ec980db6b5e7.zip |
Common 5a0689a and c63fb05
Diffstat (limited to 'lib/edi/common.cpp')
-rw-r--r-- | lib/edi/common.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/edi/common.cpp b/lib/edi/common.cpp index abaf2ed..c99997a 100644 --- a/lib/edi/common.cpp +++ b/lib/edi/common.cpp @@ -154,6 +154,7 @@ void TagDispatcher::push_bytes(const vector<uint8_t> &buf) while (m_input_data.size() > 2) { if (m_input_data[0] == 'A' and m_input_data[1] == 'F') { const auto r = decode_afpacket(m_input_data); + bool leave_loop = false; switch (r.st) { case decode_state_e::Ok: m_last_sequences.pseq_valid = false; @@ -161,9 +162,11 @@ void TagDispatcher::push_bytes(const vector<uint8_t> &buf) break; case decode_state_e::MissingData: /* Continue filling buffer */ + leave_loop = true; break; case decode_state_e::Error: m_last_sequences.pseq_valid = false; + leave_loop = true; break; } @@ -174,6 +177,10 @@ void TagDispatcher::push_bytes(const vector<uint8_t> &buf) back_inserter(remaining_data)); m_input_data = remaining_data; } + + if (leave_loop) { + break; + } } else if (m_input_data[0] == 'P' and m_input_data[1] == 'F') { PFT::Fragment fragment; |