Bug #244 » ttxtsubs-discard-dup-refreshes.diff
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);
|
||