[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/avkode/avkode
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2006-08-29 12:17:40
Message-ID: 1156853860.811823.14476.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 578474 by carewolf:

More adjustment to buffer management


 M  +3 -0      bytebuffer.cpp  
 M  +2 -1      bytestream.h  
 M  +0 -1      file.cpp  
 M  +6 -1      kio.cpp  


--- branches/work/avkode/avkode/bytebuffer.cpp #578473:578474
@@ -157,6 +157,9 @@
     else
     if (closed) len = content();
 
+    // Cannot wait for more than buffer-size
+    if (len > length) len = length;
+
     while (content() < len) {
         not_empty.wait(&mutex);
         if (released)
--- branches/work/avkode/avkode/bytestream.h #578473:578474
@@ -56,7 +56,8 @@
     * If only one thread is reading this garuantees a read of this many bytes will succede.
     */
     virtual long waitFor(unsigned long len) = 0;
-    virtual void setBufferSize(unsigned long len) = 0;
+    virtual void setBufferSize(unsigned long /*len*/) {}
+    virtual unsigned long bufferSize() const { return -1;}
 
     virtual long position() const = 0;
     virtual long length() const { return -1; }
--- branches/work/avkode/avkode/file.cpp #578473:578474
@@ -58,7 +58,6 @@
     long waitFor(unsigned long) {
         return available();
     }
-    void setBufferSize(unsigned long) {}
 
     void release() {}
     void reset() {}
--- branches/work/avkode/avkode/kio.cpp #578473:578474
@@ -110,7 +110,12 @@
         }
         return content;
     }
-    void setBufferSize(unsigned long) {}
+    void setBufferSize(unsigned long len) {
+        m_buffer->setBufferSize(len);
+    }
+    unsigned long bufferSize() const {
+        return m_buffer->bufferSize();
+    }
     void release() {
         m_buffer->release();
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic