git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
finish dvb-s2 fec stuff
[enigma2.git]
/
lib
/
dvb
/
pesparse.cpp
diff --git
a/lib/dvb/pesparse.cpp
b/lib/dvb/pesparse.cpp
index 7e05c96ac562013d7191e8d2d955a8c513802908..30e05894be105070478b805d3614b3a8ad084f92 100644
(file)
--- a/
lib/dvb/pesparse.cpp
+++ b/
lib/dvb/pesparse.cpp
@@
-1,3
+1,4
@@
+#include <lib/base/eerror.h>
#include <lib/dvb/pesparse.h>
#include <memory.h>
#include <lib/dvb/pesparse.h>
#include <memory.h>
@@
-16,8
+17,10
@@
void ePESParser::setStreamID(unsigned char id)
m_header[3] = id;
}
m_header[3] = id;
}
-void ePESParser::processData(
unsigned char
*p, int len)
+void ePESParser::processData(
const __u8
*p, int len)
{
{
+ int i;
+
/* this is a state machine, handling arbitary amounts of pes-formatted data. */
while (len)
{
/* this is a state machine, handling arbitary amounts of pes-formatted data. */
while (len)
{
@@
-40,9
+43,12
@@
void ePESParser::processData(unsigned char *p, int len)
} else
{
if (m_pes_position < 4)
} else
{
if (m_pes_position < 4)
- if (*p !=
"\x00\x00\x01\xbd"
[m_pes_position])
+ if (*p !=
m_header
[m_pes_position])
{
{
+// eDebug("sync lost at %d (%02x)", m_pes_position, *p);
m_pes_position = 0;
m_pes_position = 0;
+ while (m_header[m_pes_position] == *p) /* guaranteed to stop at the old m_pes_position */
+ m_pes_position++;
p++;
len--;
continue;
p++;
len--;
continue;