Project

General

Profile

Bug #244 » ttxtsubs-discard-dup-refreshes.diff

mjl, 02/15/2010 05:30 AM

View differences:

ttxtsubsdisplay.c
if ((tv.tv_usec - _lastDataTime->tv_usec) > 500000)
{
_pageState = interimshow;
ClearOSD();
ShowOSD();
}
}
......
if (_pageState == collecting)
{
_pageState = finished;
ClearOSD();
ShowOSD();
}
if (_pageState == interimshow)
......
{
cOSDSelfMemoryLock selfmem(&gSelfMem);
cMutexLock lock(&_osdLock);
static char lastDisplayedPage[sizeof (_page.data)];
static unsigned int ignored=0;
if (!globals.mRealDoDisplay) return;
if (!_doDisplay) return;
if (_pageState != interimshow && _pageState != finished) return;
if (0!=memcmp(lastDisplayedPage,_page.data,sizeof(_page.data))) {
memcpy(lastDisplayedPage,_page.data,sizeof(_page.data));
} else {
ignored++;
return;
}
isyslog("ttxtsubs: discarded %i refreshes since last displayed page",ignored);
ignored=0;
UpdateSubtitleTextLines();
if (_numberOfSubTitleTextLines <= 0) return;
if (_numberOfSubTitleTextLines <= 0) {DELETENULL(_osd); return;}
DELETENULL(_osd);
(1-1/2)