Fixed the cutting mechanism to make it re-sync in case a frame is larger than the buffer

This commit is contained in:
Klaus Schmidinger 2002-05-18 14:18:06 +02:00
parent 5b64f51b0b
commit 720f1ffd7b
3 changed files with 13 additions and 3 deletions

View File

@ -335,3 +335,7 @@ Rudi Hofer (Rudi.Hofer@cadsoft.de)
Gregoire Favre <greg@ulima.unil.ch> Gregoire Favre <greg@ulima.unil.ch>
for fixing some function headers to make them compile with gcc 3.x for fixing some function headers to make them compile with gcc 3.x
Sven Grothklags <sven@uni-paderborn.de>
for fixing the cutting mechanism to make it re-sync in case a frame is larger
than the buffer

View File

@ -1248,3 +1248,5 @@ Video Disk Recorder Revision History
- Updated 'Premiere Sport 2' in channels.conf (thanks to Rudi Hofer). - Updated 'Premiere Sport 2' in channels.conf (thanks to Rudi Hofer).
- Fixed some function headers to make them compile with gcc 3.x (thanks to - Fixed some function headers to make them compile with gcc 3.x (thanks to
Gregoire Favre). Gregoire Favre).
- Fixed the cutting mechanism to make it re-sync in case a frame is larger than the
buffer (thanks to Sven Grothklags).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "dvbapi.h"
@ -1527,11 +1527,15 @@ void cCuttingBuffer::Action(void)
CurrentFileNumber = FileNumber; CurrentFileNumber = FileNumber;
} }
if (fromFile >= 0) { if (fromFile >= 0) {
Length = ReadFrame(fromFile, buffer, Length, sizeof(buffer)); int len = ReadFrame(fromFile, buffer, Length, sizeof(buffer));
if (Length < 0) { if (len < 0) {
error = "ReadFrame"; error = "ReadFrame";
break; break;
} }
if (len != Length) {
CurrentFileNumber = 0; // this re-syncs in case the frame was larger than the buffer
Length = len;
}
} }
else { else {
error = "fromFile"; error = "fromFile";