Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: since vdr-1.0.x a lot of restarts in record mode



Hello,

I couldn't get vdr 1.0.2 with the AIO patch to record reliably in divx 
mode. It would record for a while, then hang for 30 seconds or so, then 
crash. I've tracked down the problem to a bug in the "ringbuffer" code: if 
the buffer becomes full because the divx encoder cannot keep up, the data 
stream is completely broken.

The following patch solves the problem by throwing away the buffer contents 
when it is full: you get a glitch in the recording, but I don't see how 
this can be avoided if the encoder is too slow:

--- BUILD.orig/vdr-1.0.2/ringbuffer.c  	Thu Apr 18 16:46:36 2002
+++ BUILD/vdr-1.0.2/ringbuffer.c       	Tue Jun  4 10:07:36 2002
@@ -154,7 +154,7 @@
       Lock();
       int rest = Size() - head;
       int diff = tail - head;
-     int free = (diff > 0) ? diff - 1 : Size() + diff - 1;
+     int free = (diff > 0) ? diff : Size() + diff;
       if (statistics) {
          int fill = Size() - free - 1 + Count;
          if (fill >= Size())
@@ -196,7 +196,7 @@
       int rest = Size() - tail;
       int diff = head - tail;
       int cont = (diff >= 0) ? diff : Size() + diff;
-     if (rest > 0) {
+     if (cont > 0) {
          if (cont < Count)
             Count = cont;
          if (Count >= rest) {

I don't know whether this problem could occur when recording in regular 
mpeg2 mode.

Regards,
John
______________________________________________
The information contained in this e-mail is intended only for the person
or entity to which it is addressed and may contain confidential and/or
privileged material. If you are not the intended recipient of this
e-mail, the use of this information or any disclosure, copying or
distribution is prohibited and may be unlawful.
If you received this in error, please contact the sender and delete the
material from any computer.
The views expressed in this e-mail may not necessarily be the views of
The PCMS Group plc and should not be taken as authority to carry out any
instruction contained.





Home | Main Index | Thread Index