[mythtv] [mythtv-commits] Ticket #3361: Improve Preview Generation

Michael T. Dean mtdean at thirdcontact.com
Sat Dec 8 19:04:09 UTC 2007

On 12/08/2007 01:39 PM, Chris Pinkham wrote:
> * On Sat Dec 08, 2007 at 05:46:55PM -0000, MythTV wrote:
>> #3361: Improve Preview Generation
>> Comment(by sphery <mtdean at thirdcontact.com>):
>>  The attached patch, mythtv-find_file_for_preview_gen.patch , modifies the
>>  Storage Group changes committed in [15029] based on the suggestion from
>>  Chris Pinkham at http://www.gossamer-
>>  threads.com/lists/mythtv/dev/303576#303576 .  I think the changes are as
>>  he suggested and fit in well with the preview generator changes in
>>  [15029], but I'm happy to make additional changes as necessary.
> Daniel already has a patch to correct this issue which actually reverts
> part of his original patch based on my comments in the above thread.

Sounds good.  As he had a plan for the original preview generation
changes patch, and I looked only at fixing the immediate problem--I
didn't go through all the rest of his patch--I'm sure his changes will
fit better into the big picture.  More than anything, I just needed
something to prevent my backend from getting swamped by preview
generation.  And, a quick fix is available for anyone else until Daniel
finishes his changes (so Daniel doesn't have to make this change top

>>  Without the patch, going to the MythWeb Recorded Programs page takes
>>  forever and results in a huge CPU usage spike (mythbackend was running at
>>  100% on my Athlon XP 2400+ (load average > 6) for so long that I just
> I just had another thought about this that would improve preview speed. In
> programs/mythbackend/backendutil.cpp, I added a recordingPathCache along
> with the appropriate lock and exported GetPlaybackURL() function.  It
> probably makes sense to move this caching to the Storage Group level in
> libs/libmythtv/storagegroup.cpp.  We should be able to get rid of the
> recordingPathCache if we had a StorageGroupCache.  The StorageGroupCache
> would give us speedups for anything looking for a file in a Storage Group
> directory.  That way we'd get the benefit of the cache for any files that
> are stored in a Storage Group, including the recordings, pixmaps, and
> anything else we store there later.

Great plan--especially since I have several ideas for things to store
there... ;)  Just need to get done with the big change at the top of my
TODO list (which will put the first other thing--DB backups--in there).

I'm also looking at modifying the preview generator so that if a
specially-named storage group--i.e. 'Previews' or 'Thumbnails' or
something--exists, the preview pixmaps are stored there rather than in
the "normal" recording directories (kind of like the LiveTV storage
group puts LiveTV recordings into a specific dir(s)).  This would allow
us to clean up the recordings directories--so they just contain, er,
recordings.  :)  I'll wait until Daniel's changes settle out a bit
before implementing that, though.


More information about the mythtv-dev mailing list