#1498: two small fixes for the OSD cache
-------------------------+--------------------------------------------------
Reporter: visit0r | Owner: danielk
Type: enhancement | Status: new
Priority: minor | Milestone:
Component: mythtv | Version: head
Severity: medium |
-------------------------+--------------------------------------------------
Subtitles were not cleared in channel change. For some reason I got this
problem only after the OSD cache was implemented. It might be somehow
caused by it (I don't get why because subtitles are not cached), or just
revealed by it due to more quicker channel change (just a wild guess).
Anyways, I simply inserted
{{{
if (osdHasSubtitles || nonDisplayedSubtitles.size() > 0)
ClearSubtitles();
}}}
in NuppelVideoPlayer::JumpProgram() which seems to get called in each
channel change, thus clearing the subtitles of the previous channel.
Another issue I noted from reviewing the final OSD cache patch DanielK
created was that for images that are not cached (e.g., subtitles), the
bitmaps are never freed. I changed the
destructor of OSDTypeImage to the following, which should avoid the memory
leak:
{{{
OSDTypeImage::~OSDTypeImage()
{
if (!cache.InMemCache()) {
if (m_yuv)
delete [] m_yuv;
if (m_alpha)
delete [] m_alpha;
} else {
cache.Reset();
}
}
}}}
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/1498>
MythTV <http://www.mythtv.org/>
MythTV