aboutsummaryrefslogtreecommitdiffstats
path: root/libMpegTPDec/src/tpdec_lib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libMpegTPDec/src/tpdec_lib.cpp')
-rw-r--r--libMpegTPDec/src/tpdec_lib.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp
index 10e3352..306bec0 100644
--- a/libMpegTPDec/src/tpdec_lib.cpp
+++ b/libMpegTPDec/src/tpdec_lib.cpp
@@ -1151,6 +1151,12 @@ static TRANSPORTDEC_ERROR synchronization(HANDLE_TRANSPORTDEC hTp,
&syncLayerFrameBits, &fConfigFound,
&headerBits);
if (TPDEC_IS_FATAL_ERROR(err)) {
+ /* Rewind - TPDEC_SYNCSKIP, in order to look for a synch one bit ahead
+ * next time. Ensure that the bit amount lands at a multiple of
+ * TPDEC_SYNCSKIP. */
+ FDKpushBiDirectional(
+ hBs, -headerBits + TPDEC_SYNCSKIP + (bitsAvail % TPDEC_SYNCSKIP));
+
goto bail;
}
}