Mailing List archive

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

[vdr] Re: Recordings menu sluggish - *the real* solution. :-)



Am Sonntag, 5. Oktober 2003 15:24 schrieben Sie:
> Am Sonntag, 5. Oktober 2003 15:18 schrieben Sie:
> > From what I've seen in the link Michael Hoffmann has posted
> > (http://kerneltrap.org/node/view/460) I'd say that sounds
> > a lot more promising...

It works very good :-)
My VDR runs on a Vanilla Linux 2.4.22 + the O_STREAMING patch from:
http://groups.google.com/groups?selm=1034044736.29463.318.camel%40phantasy&output=gplain
The cache does not fill up with the nnn.vdr files. If i exit a playing movie 
the Recordings menu is there without a long search on the disk. Seeking in 
the movie does not show any changes.

Michael 

The following patch was successfuly tested with vdr-1.2.5

diff -Nru VDR/recording.c vdr_patched/recording.c
--- VDR/recording.c     2003-08-17 11:10:46.000000000 +0200
+++ vdr_patched/recording.c     2003-10-05 16:39:45.000000000 +0200
@@ -21,6 +21,8 @@
 #include "tools.h"
 #include "videodir.h"

+#define O_STREAMING 04000000
+
 #define RECEXT       ".rec"
 #define DELEXT       ".del"
 /* This was the original code, which works fine in a Linux only environment.
@@ -175,7 +177,7 @@
         if ((st.st_mode & S_IWUSR) == 0) // no write access, assume no resume
            return -1;
         }
-     int f = open(fileName, O_RDONLY);
+     int f = open(fileName, O_RDONLY | O_STREAMING);
      if (f >= 0) {
         if (safe_read(f, &resume, sizeof(resume)) != sizeof(resume)) {
            resume = -1;
@@ -807,7 +809,7 @@
                  size = last + 1;
                  index = MALLOC(tIndex, size);
                  if (index) {
-                    f = open(fileName, O_RDONLY);
+                    f = open(fileName, O_RDONLY | O_STREAMING);
                     if (f >= 0) {
                        if ((int)safe_read(f, index, buf.st_size) != 
buf.st_size) {
                           esyslog("ERROR: can't read from file '%s'", 
fileName);
@@ -1041,7 +1043,7 @@
      else {
         if (access(fileName, R_OK) == 0) {
            dsyslog("playing '%s'", fileName);
-           file = open(fileName, O_RDONLY | BlockingFlag);
+           file = open(fileName, O_RDONLY | BlockingFlag | O_STREAMING);
            if (file < 0)
               LOG_ERROR_STR(fileName);
            }



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



Home | Main Index | Thread Index