summaryrefslogtreecommitdiff
path: root/dvbapi.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-05-18 09:24:10 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-05-18 09:24:10 +0200
commit26a2d985243eed98276f0bc68dc7db6f61d87128 (patch)
treeb062ef7cd6cd1129864c99e9980f993d5e64a89f /dvbapi.c
parent7da1dc6e1df129d0c04b3904c97d7544d7a3c88d (diff)
downloadvdr-26a2d985243eed98276f0bc68dc7db6f61d87128.tar.gz
vdr-26a2d985243eed98276f0bc68dc7db6f61d87128.tar.bz2
Fixed the cutting mechanism to make it re-sync in case a frame is larger than the buffer
Diffstat (limited to 'dvbapi.c')
-rw-r--r--dvbapi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dvbapi.c b/dvbapi.c
index 0b14a871..7475a0b6 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.175 2002/05/13 16:29:17 kls Exp $
+ * $Id: dvbapi.c 1.176 2002/05/18 09:21:39 kls Exp $
*/
#include "dvbapi.h"
@@ -1527,11 +1527,14 @@ 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";