[mythtv] Patch: avoid waiting before preview PNG generation

Andy Poling andy at realbig.com
Mon Jan 31 20:48:58 EST 2005

A while back someone added a multiple-timeout wait to RingBuffer::RingBuffer()
- I'm guessing to deal with a race condition.

For whatever reason, that function is apparently also used to retrieve the PNG
preview images, and the multiple timeouts result in an unnecessary 3-4 second
delay before generating a new preview image every time you're in the recording
list and you hit a recording that hasn't yet had a preview image generated.

I'm not at all certain that this is the correct way to fix this problem, but
the following patch (against CVS as of Saturday) will set openAttempts to 1
instead of 5 for all files not ending in ".nuv".  It adds the following two
lines to RingBuffer::RingBuffer()

    if (filename.right(4) != ".nuv")
        openAttempts = 1;

-------------- next part --------------
*** libs/libmythtv/RingBuffer.cpp.orig	Thu Jan 13 13:55:44 2005
--- libs/libmythtv/RingBuffer.cpp	Mon Jan 31 20:17:09 2005
*** 354,359 ****
--- 354,362 ----
      normalfile = true;
      filename = (QString)lfilename;
+     if (filename.right(4) != ".nuv")
+         openAttempts = 1;
      if (write)
          tfw = new ThreadedFileWriter(filename.ascii(),

More information about the mythtv-dev mailing list