From a3d9b92615fbbc4a7632477a7cf05fd9cfb410c4 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 24 Jan 2003 14:30:02 +0100 Subject: [PATCH] Increased the maximum possible packet size to avoid corrupted streams --- CONTRIBUTORS | 4 ++++ HISTORY | 4 +++- remux.c | 8 +++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f17b84e4..279c0dfb 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -525,3 +525,7 @@ Walter Stroebel Paul Gohn for adding 'Hrvatska radiotelevizija' and 'RTV Slovenija' to ca.conf + +Teemu Rantanen + for increased the maximum possible packet size in remux.c to avoid corrupted streams + with broadcasters that send extremely large PES packets diff --git a/HISTORY b/HISTORY index 3e64bd5e..b4bdbcbc 100644 --- a/HISTORY +++ b/HISTORY @@ -1917,7 +1917,7 @@ Video Disk Recorder Revision History EPG data, that string is now limited in length when used in a recording's file name. -2003-01-19: Version 1.1.22 +2003-01-24: Version 1.1.22 - Added 'Hrvatska radiotelevizija' and 'RTV Slovenija' to ca.conf (thanks to Paul Gohn). @@ -1925,3 +1925,5 @@ Video Disk Recorder Revision History - Since disk file systems apparently don't honor the O_NONBLOCK flag to read from a file in non-blocking mode the cDvbPlayer now uses a non blocking file reader class to make sure replay remains smooth even under heavy system load. +- Increased the maximum possible packet size in remux.c to avoid corrupted streams + with broadcasters that send extremely large PES packets (thanks to Teemu Rantanen). diff --git a/remux.c b/remux.c index 786bb8fe..7efe5dce 100644 --- a/remux.c +++ b/remux.c @@ -8,7 +8,7 @@ * the Linux DVB driver's 'tuxplayer' example and were rewritten to suit * VDR's needs. * - * $Id: remux.c 1.12 2002/10/12 13:33:54 kls Exp $ + * $Id: remux.c 1.13 2003/01/24 14:21:17 kls Exp $ */ /* The calling interface of the 'cRemux::Process()' function is defined @@ -103,8 +103,8 @@ #define ADAPT_FIELD 0x20 //XXX TODO -#define MAX_PLENGTH 0xFFFF -#define MMAX_PLENGTH (4*MAX_PLENGTH) +#define MAX_PLENGTH 0xFFFF // the maximum PES packet length (theoretically) +#define MMAX_PLENGTH (8*MAX_PLENGTH) // some stations send PES packets that are extremely large, e.g. DVB-T in Finland #define IPACKS 2048 @@ -384,6 +384,8 @@ void cTS2PES::instant_repack(const uint8_t *Buf, int Count) } if (plength && found == plength + 6) { + if (plength == MMAX_PLENGTH - 6) + esyslog("ERROR: PES packet length overflow in remuxer (stream corruption)"); send_ipack(); reset_ipack(); if (c < Count)