Mailing List archive

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

[vdr] Re: Necessity of Emergency Exits...



Hi Karsten,

That's the original patch from Klaus:
---------------------------------------------------------------
--- dvbapi.c    2002/03/29 11:32:47
+++ dvbapi.c    2002/03/16 14:20:47
@@ -525,7 +527,6 @@
   time_t t = time(NULL);
   recording = true;
   for (;;) {
-      if (cFile::FileReady(videoDev, 100)) {
          int r = read(videoDev, b, sizeof(b));
          if (r > 0) {
             uchar *p = b;
@@ -546,12 +547,12 @@
                   }
                }
             }
-         }
       if (time(NULL) - t > MAXBROKENTIMEOUT) {
          esyslog(LOG_ERR, "ERROR: video data stream broken");
          cThread::EmergencyExit(true);
          t = time(NULL);
          }
+      cFile::FileReady(videoDev, 100);
       if (!recording)
          break;
       }

---------------------------------------------------------------
I think the line numbers hase changed.

My patch:
Original dvapi.c
line 526

  for (;;) {
      if (cFile::FileReady(videoDev, 100)) {
         int r = read(videoDev, b, sizeof(b));
         if (r > 0) {
            uchar *p = b;
            while (r > 0) {
                  int w = Put(p, r);
                  p += w;
                  r -= w;
                  if (r > 0)
                     usleep(1); // this keeps the CPU load low
                  }
            t = time(NULL);
            }
         else if (r < 0) {
            if (FATALERRNO) {
               if (errno == EBUFFEROVERFLOW) // this error code is not defined
in the library
                  esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow",
__FILE__, __LINE__);
               else {
                  LOG_ERROR;
                  break;
                  }
               }
            }
         }
      if (time(NULL) - t > MAXBROKENTIMEOUT) {
         esyslog(LOG_ERR, "ERROR: video data stream broken");
         cThread::EmergencyExit(true);
         t = time(NULL);
         }
      if (!recording)
         break;
      }

changed to:
(same number of lines)

  for (;;) {
//      if (cFile::FileReady(videoDev, 100)) {
         int r = read(videoDev, b, sizeof(b));
         if (r > 0) {
            uchar *p = b;
            while (r > 0) {
                  int w = Put(p, r);
                  p += w;
                  r -= w;
                  if (r > 0)    //
                     usleep(1); // this keeps the CPU load low
                  }
            t = time(NULL);
            }
         else if (r < 0) {
            if (FATALERRNO) {
               if (errno == EBUFFEROVERFLOW) // this error code is not defined
in the library
                  esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow",
__FILE__, __LINE__);
               else {
                  LOG_ERROR;
                  break;
                  }
               }
            }
//         }
      if (time(NULL) - t > MAXBROKENTIMEOUT) {
         esyslog(LOG_ERR, "ERROR: video data stream broken");
         cThread::EmergencyExit(true);
         t = time(NULL);         }
      cFile::FileReady(videoDev, 100);
      if (!recording)
         break;
      }



Karsten Müller schrieb:

> -----BEGIN PGP SIGNED MESSAGE-----
>
> On Tuesday 23 July 2002 11:23, Otto Felbecker wrote:
> > Hi,
> > the code changed in dvbapi.c from vdr-1.0.0.pre4 to pre5. I always patch
> > the dvbapi.c with old pre4 code (watch for the exact line numbers for the
> > AIO patch). From this point all the restart problems (perhaps weak signal)
> > are gone. Ok i live with audio/video glitches, no problem at all.
> > Otto
> >
>
> That would be my solution :) Where can I get that patch from ?
> Maybe we could (re-) incorporate that source into the "normal"
> tree encapsulated within a build option like e.g. "NORESTARTS=1"
>
> > Karsten Müller schrieb:
>
> [...lots of stuff deleted...]
>
> - --
> with best regards
> - ---
> Karsten Mueller
> Softwaredevelopment / Keyaccount Manager
> RATIO Entwicklungen GmbH
> Admiralitaetstr. 59
> 20459 Hamburg
> Email: mailto:kmu@ratio.de
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iQEVAwUBPT0x/Pa/7v6IZOEZAQFkxQf/arODKk6yqflb/PmfKgWwtxXmNawkLyS3
> Edm+sXetsR+1xip+49RxqspTIThqEd3gL//0eKJDtulhUflk6grHjp8BObmMGuzB
> WChgS/QFIj16rjERBeJEMpreG19V17eOoqhtdsR1ffviYCDb84wDXfM81RjRBIgZ
> aTitpzrYaw5yl/EdBEY1hDvdLkkWJ6rr9D5QcmaxtJkXwANWa4sCN33SLYwFvdnS
> ugF0xWA+f8ZT8Tr6djWw6XKBSTmfLTI2ve+ehFF3vBIBQpnPneska+5v15EIhEFN
> xIjCxdchfLjylKNQ4RKacoA76P1l5nAZbO+iKJGAgqYdQ0wnXc0dDA==
> =uVzp
> -----END PGP SIGNATURE-----





Home | Main Index | Thread Index