Skip to content

Commit 03d161d

Browse files
author
Mark Kendall
committed
Backport r27213 from trunk to release-0-24-fixes
Teletext fixes. * add a TryLockOSD method to MythPlayer which will wait 50ms for the lock and use this in the teletext decoder. * Only decode teletext data if teletext based captions are enabled. The latter will introduce a certain amount of delay between enabling teletext items and their display on screen as the teletext data is no longer continuously cached. git-svn-id: http://svn.mythtv.org/svn/branches/release-0-24-fixes@27220 7dbf422c-18fa-0310-86e9-fd20926502f2
1 parent bdae22c commit 03d161d

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

mythtv/libs/libmythtv/mythplayer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@ class MPUBLIC MythPlayer
297297
QMap<long long, long long> &posMap);
298298

299299
// OSD locking for TV class
300-
void LockOSD(void) { osdLock.lock(); }
301-
void UnlockOSD(void) { osdLock.unlock(); }
300+
bool TryLockOSD(void) { return osdLock.tryLock(50); }
301+
void LockOSD(void) { osdLock.lock(); }
302+
void UnlockOSD(void) { osdLock.unlock(); }
302303

303304
protected:
304305
// Initialization

mythtv/libs/libmythtv/teletextdecoder.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,19 @@ void TeletextDecoder::Decode(const unsigned char *buf, int vbimode)
5353
if (!m_player)
5454
return;
5555

56-
m_player->LockOSD();
56+
int mode = m_player->GetCaptionMode();
57+
if (!((mode == kDisplayNUVTeletextCaptions) ||
58+
(mode == kDisplayTeletextCaptions) ||
59+
(mode == kDisplayTeletextMenu)))
60+
{
61+
return;
62+
}
63+
64+
if (!m_player->TryLockOSD())
65+
{
66+
VERBOSE(VB_PLAYBACK, "TeletextDecoder: Failed to get OSD lock.");
67+
return;
68+
}
5769

5870
if (!m_teletextviewer && m_player)
5971
{

mythtv/libs/libmythtv/teletextscreen.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,9 @@ void TeletextScreen::AddPageHeader(int page, int subpage,
469469
const uint8_t * buf,
470470
int vbimode, int lang, int flags)
471471
{
472+
if (!m_displaying)
473+
return;
474+
472475
QMutexLocker locker(&m_lock);
473476

474477
int magazine = MAGAZINE(page);
@@ -547,6 +550,9 @@ void TeletextScreen::AddPageHeader(int page, int subpage,
547550
void TeletextScreen::AddTeletextData(int magazine, int row,
548551
const uint8_t * buf, int vbimode)
549552
{
553+
if (!m_displaying)
554+
return;
555+
550556
QMutexLocker locker(&m_lock);
551557

552558
int b1, b2, b3, err = 0;

0 commit comments

Comments
 (0)