[mythtv] [PATCH] O_STREAMING patch

steve at nexusuk.org steve at nexusuk.org
Mon Dec 22 13:07:29 EST 2003


This patch sets the O_STREAMING flag when the ring buffer is opened to 
instruct the kernel not to cache the data once it's been accessed.  The 
result is a much more responsive frontend after watching TV since most of 
the frontend's files haven't been expired from the kernel's pagecache.

You also need the O_STREAMING kernel patch: 
    http://kerneltrap.org/node/view/460

MythTV patches available at:  http://www.nexusuk.org/projects/pvr/patches/

-- 

 - Steve                                             http://www.nexusuk.org/

     Servatis a periculum, servatis a maleficum - Whisper, Evanescence
-------------- next part --------------
diff -urN mythtv-0.13.vanilla/libs/libmythtv/RingBuffer.cpp mythtv-0.13.o_streaming/libs/libmythtv/RingBuffer.cpp
--- mythtv-0.13.vanilla/libs/libmythtv/RingBuffer.cpp	2003-12-02 06:23:20.000000000 +0000
+++ mythtv-0.13.o_streaming/libs/libmythtv/RingBuffer.cpp	2003-12-20 13:37:59.000000000 +0000
@@ -21,6 +21,7 @@
 #include "remoteencoder.h"
 
 #define TFW_BUF_SIZE (2*1024*1024)
+#define O_STREAMING 04000000
 
 class ThreadedFileWriter
 {
@@ -303,7 +304,7 @@
             is_local = true;
 
         if (is_local)
-            fd2 = open(filename.ascii(), O_RDONLY|O_LARGEFILE);
+            fd2 = open(filename.ascii(), O_RDONLY|O_LARGEFILE|O_STREAMING);
         else
             remotefile = new RemoteFile(filename, needevents);
         writemode = false;
@@ -332,7 +333,7 @@
         tfw = new ThreadedFileWriter(filename.ascii(), 
                                      O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 
                                      0644);
-        fd2 = open(filename.ascii(), O_RDONLY|O_LARGEFILE);
+        fd2 = open(filename.ascii(), O_RDONLY|O_LARGEFILE|O_STREAMING);
     }
     else
     {


More information about the mythtv-dev mailing list