summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-05-03 14:45:53 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2009-05-03 14:45:53 +0200
commitb0d380ba06d7e7a36097d380c94a33358b68caab (patch)
treeff6da4bdc53b0ee0ff903a489040918b7dd15be3
parentf161d1b2fe69d4fcfac37581fa60b5d9ce5ded11 (diff)
downloadvdr-b0d380ba06d7e7a36097d380c94a33358b68caab.tar.gz
vdr-b0d380ba06d7e7a36097d380c94a33358b68caab.tar.bz2
cFrameDetector::Analyze() now syncs on the TS packet sync bytes1.7.7
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY2
-rw-r--r--remux.c9
3 files changed, 11 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 18c326c5..7bdc251b 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -671,6 +671,7 @@ Oliver Endriss <o.endriss@gmx.de>
for reporting that the video type is unnecessarily written into channels.conf if
VPID is 0
for reporting chirping sound disturbences at editing points in TS recordings
+ for reporting broken index generation in TS recordings after a buffer overflow
Reinhard Walter Buchner <rw.buchner@freenet.de>
for adding some satellites to 'sources.conf'
diff --git a/HISTORY b/HISTORY
index ffafea42..d94e1612 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6072,3 +6072,5 @@ Video Disk Recorder Revision History
screen OSD on HD systems.
- The OSD size is now automatically adjusted to the actual video display
(provided the output device implements the GetVideoSize() function).
+- cFrameDetector::Analyze() now syncs on the TS packet sync bytes (thanks to
+ Oliver Endriss for reporting broken index generation after a buffer overflow).
diff --git a/remux.c b/remux.c
index 10e5145c..58c05311 100644
--- a/remux.c
+++ b/remux.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remux.c 2.19 2009/04/19 10:59:56 kls Exp $
+ * $Id: remux.c 2.20 2009/05/03 14:43:25 kls Exp $
*/
#include "remux.h"
@@ -722,6 +722,13 @@ int cFrameDetector::Analyze(const uchar *Data, int Length)
int Processed = 0;
newFrame = independentFrame = false;
while (Length >= TS_SIZE) {
+ if (Data[0] != TS_SYNC_BYTE) {
+ int Skipped = 1;
+ while (Skipped < Length && (Data[Skipped] != TS_SYNC_BYTE || Length - Skipped > TS_SIZE && Data[Skipped + TS_SIZE] != TS_SYNC_BYTE))
+ Skipped++;
+ esyslog("ERROR: skipped %d bytes to sync on start of TS packet", Skipped);
+ return Processed + Skipped;
+ }
if (TsHasPayload(Data) && !TsIsScrambled(Data) && TsPid(Data) == pid) {
if (TsPayloadStart(Data)) {
if (!frameDuration) {