Opened 14 years ago

Closed 14 years ago

#3584 closed patch (fixed)

Don't pre-cache glyphs for non-displayable control chars

Reported by: sphery <mtdean@…> Owned by: stuartm
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no


The attached patch changes the OSD to skip pre-caching of glyphs for the C0 (0-31) and C1 (127-159) control characters. Since they are non-displayable characters, they shouldn't have any glyphs, so we're just caching 65 copies of the "no glyph" rectangle for each font.

Upon playback startup, my machine creates 120 fonts and pre-caches the glyphs for the first 256 characters of each, regardless of whether they're already cached elsewhere. Therefore, skipping 65 non-displayable glyphs for 120 fonts saves caching 7800 glyphs that likely won't be used.

If the glyph is later requested, it will be cached at that point, so this won't create issues if any of these characters are actually used. However, after applying this patch to my working copy, the only glyph that was ever requested from this range (in almost 2 weeks of admittedly 8859-1-centric use with captions enabled) is that for U+000a (linefeed). While we could just pre-cache that glyph, it's not used in all programs, so it makes more sense to me to let it be cached upon request.

While the fact that these characters (or at least the C1 control characters) are non-displayable may be specific to 8859-n encodings, the idea of pre-caching the first 256 glyphs from the font is probably equally 8859-n (or possibly even 8859-1) specific. And, since the glyphs will be cached on request, it doesn't hurt to skip pre-caching them. As a matter of fact, chances are that if one of these glyphs is requested, it will only be for the font that's actually being used (i.e. the VBI CC font or the OSD font or ...) rather than caching the glyph for each of the 120 fonts that may be used during playback.

Note that my machine was set to use FreeSans? for /all/ caption fonts, including the ATSC mono/serif/sans in regular/italic/bold/oblique and was using the Retro-OSD theme. Therefore, only 3 unique fonts, Bitstream Vera Sans (Bold), Bitstream Vera Sans (Roman), and FreeSans? (Medium), were actually used even though 120 were created (although some may have been different sizes).

Attachments (1)

mythtv-caption_pre_cache_skip_control_chars.patch (529 bytes) - added by sphery <mtdean@…> 14 years ago.

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by sphery <mtdean@…>

comment:1 Changed 14 years ago by stuartm

Owner: changed from Isaac Richards to stuartm

comment:2 Changed 14 years ago by stuartm

Milestone: unknown0.21

comment:3 Changed 14 years ago by stuartm

Resolution: fixed
Status: newclosed

(In [13612]) Apply patch by Sphery to skip pre-caching non-displayable characters at the start of playback.

Closes #3584

Note: See TracTickets for help on using tickets.