Mailing List archive

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

[vdr] Re: qestion about thread priorities-> suggestion



On Sat, 14 Feb 2004 16:35:30 +0100, Guido Fiala <gfiala@s.netic.de>
wrote:

> > To improve the situation VDR would have to throttle the disk accesses by
> > it self.
> 
> So adding a usleep() in the loop might help?

Here is a easy patch:

--- cutter.c.orig       2004-02-09 15:59:16.000000000 +0100
+++ cutter.c    2003-09-12 12:26:24.000000000 +0200
@@ -74,6 +74,7 @@
      int FileSize = 0;
      int CurrentFileNumber = 0;
      int LastIFrame = 0;
+     int i = 0;
      toMarks.Add(0);
      toMarks.Save();
      uchar buffer[MAXFRAMESIZE];
@@ -88,6 +89,8 @@

            AssertFreeDiskSpace(-1);

+           if (i++%3 == 0) usleep(1000);
+
            // Read one frame:

            if (fromIndex->Get(Index++, &FileNumber, &FileOffset,
&PictureType, &Length)) {

You can change the used bandwidth by changing the modulo value 3.

Emil


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



Home | Main Index | Thread Index