gr-dvbs2rx
gr-dvbs2rx copied to clipboard
Check SYNCD size before filling partial MPEG-TS packet
https://github.com/igorauad/gr-dvbs2rx/blob/c22b350912f31d87e397ef3ff470ac81cef943e0/lib/bbdeheader_bb_impl.cc#L205
The logic inside this scope assumes sequential BB frames. It will break and synchronization will be lost if a BB frame has been dropped.
I would propose including the following to check whether the SYNCD size corresponds to the remaining size of the partial TS packet.
if (d_partial_ts_bytes && ((d_bbheader.syncd / 8) != TS_PACKET_LENGTH - 1 - d_partial_ts_bytes)) {
GR_LOG_DEBUG_LEVEL(3, "Not enough bytes to complete the partial TS packet.");
d_packet_drop_cnt++;
d_synched = false;
}
This would be added before evaluating the d_synched
in: https://github.com/igorauad/gr-dvbs2rx/blob/c22b350912f31d87e397ef3ff470ac81cef943e0/lib/bbdeheader_bb_impl.cc#L193