Ticket #11250: mythtv_ThreadedFileWriter_reduce_thread_wakeup.patch

File mythtv_ThreadedFileWriter_reduce_thread_wakeup.patch, 630 bytes (added by Rune Petersen <rune@…>, 14 years ago)
  • mythtv/libs/libmythtv/ThreadedFileWriter.cpp

    diff --git a/mythtv/libs/libmythtv/ThreadedFileWriter.cpp b/mythtv/libs/libmythtv/ThreadedFileWriter.cpp
    index e6ca088..2a67d9f 100644
    a b uint ThreadedFileWriter::Write(const void *data, uint count)  
    248248
    249249    writeBuffers.push_back(buf);
    250250
    251     bufferHasData.wakeAll();
     251    if (buf->data.size() >= kMinWriteSize)
     252    {
     253        bufferHasData.wakeAll();
     254    }
    252255
    253256    LOG(VB_FILE, LOG_DEBUG, LOC + QString("Write(*, %1) total %2 cnt %3")
    254257            .arg(count,4).arg(totalBufferUse).arg(writeBuffers.size()));