Mailing List archive

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

[vdr] Re: Exit state handling in runvdr



theNoad wrote:
> 
> ...
> > Isn't the ring buffer overflow a restart condition? Or a reason to exit
> > and unload/reload the DVB drivers? As far as I can see there is nothing
> > that can be done after the overflows. VDR may react to input, but it's
> > never displayed anything anymore. Once the overflow comes it's like
> > instant lobotomy, VDR is alive but not anyway alive. :)
> >
> > >If you want additional "emergency exists" when buffer overflows or things
> > >like that happen, you can just implement the necessary call at the right
> > > place. But be prepared for lots of complaints from people who are already
> > > complaining about the "emergency exists" VDR does as it is now ;-).
> >
> > Well, I think I personally rather have one exit too much than not. A
> > restart isn't so bad, an internal "half crash" where VDR can't really
> > proceed is worse.
> 
> May be this is useful for you:
> http://www.linuxtv.org/mailinglists/vdr/2003/06-2003/msg01502.html

Thanks for pointing this out - somehow this posting must have slipped by me...

Since you wrote there that the DeviceClear() call always helped and you never
ran into the "emergency exit" case, I'll adopt only this part of your patch:

--- transfer.c  2003/05/18 15:22:09     1.13
+++ transfer.c  2003/08/31 12:19:16
@@ -13,6 +13,7 @@
 // The size of the array used to buffer video data:
 // (must be larger than MINVIDEODATA - see remux.h)
 #define VIDEOBUFSIZE  MEGABYTE(1)
+#define POLLTIMEOUTS_BEFORE_DEVICECLEAR 3
 
 // --- cTransfer -------------------------------------------------------------
 
@@ -67,6 +68,7 @@
 {
   dsyslog("transfer thread started (pid=%d)", getpid());
 
+  int PollTimeouts = 0;
   active = true;
   while (active) {
 
@@ -99,6 +101,7 @@
               while (Result > 0 && active) {
                     cPoller Poller;
                     if (DevicePoll(Poller, 100)) {
+                       PollTimeouts = 0;
                        int w = PlayVideo(p, Result);
                        if (w > 0) {
                           p += w;
@@ -107,6 +110,13 @@
                        else if (w < 0 && FATALERRNO) {
                           LOG_ERROR;
                           break;
+                          }
+                       }
+                    else {
+                       PollTimeouts++;
+                       if (PollTimeouts == POLLTIMEOUTS_BEFORE_DEVICECLEAR) {
+                          dsyslog("clearing device because of consecutive poll timeouts");
+                          DeviceClear();
                           }
                        }
                     }


As I've stated on several occasions, I always want to give proper credit to
people providing patches to VDR, but I do so only for "real" people ;-)
This doesn't mean that I absolutely want to force you to come out with
your real name, I just want to make sure you're not surprized if you find
this fix in the next VDR version without a note who provided it.

Klaus


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index