From 720f1ffd7b1701723d0ee3186d3764c16ce767aa Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 18 May 2002 14:18:06 +0200 Subject: Fixed the cutting mechanism to make it re-sync in case a frame is larger than the buffer --- dvbapi.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'dvbapi.c') diff --git a/dvbapi.c b/dvbapi.c index 77e53726..04a13ce6 100644 --- a/dvbapi.c +++ b/dvbapi.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbapi.c 1.174 2002/05/03 15:59:32 kls Exp $ + * $Id: dvbapi.c 1.174.1.1 2002/05/18 14:15:36 kls Exp $ */ #include "dvbapi.h" @@ -1527,11 +1527,15 @@ void cCuttingBuffer::Action(void) CurrentFileNumber = FileNumber; } if (fromFile >= 0) { - Length = ReadFrame(fromFile, buffer, Length, sizeof(buffer)); - if (Length < 0) { + int len = ReadFrame(fromFile, buffer, Length, sizeof(buffer)); + if (len < 0) { error = "ReadFrame"; break; } + if (len != Length) { + CurrentFileNumber = 0; // this re-syncs in case the frame was larger than the buffer + Length = len; + } } else { error = "fromFile"; -- cgit v1.2.3