summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2010-11-14 14:17:38 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2010-11-14 14:17:38 (GMT)
commit03d161ddaee9f4944bf995b18a6afa141eccf2e1 (patch)
tree47edaf2a0bd21583fdbccd3b4a82ce0af777ffb9
parentbdae22cdbd01404d91cc433b876b32972db49583 (diff)
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
-rw-r--r--mythtv/libs/libmythtv/mythplayer.h5
-rw-r--r--mythtv/libs/libmythtv/teletextdecoder.cpp14
-rw-r--r--mythtv/libs/libmythtv/teletextscreen.cpp6
3 files changed, 22 insertions, 3 deletions
diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h
index 67bff88..1da0b53 100644
--- a/mythtv/libs/libmythtv/mythplayer.h
+++ b/mythtv/libs/libmythtv/mythplayer.h
@@ -297,8 +297,9 @@ class MPUBLIC MythPlayer
QMap<long long, long long> &posMap);
// OSD locking for TV class
- void LockOSD(void) { osdLock.lock(); }
- void UnlockOSD(void) { osdLock.unlock(); }
+ bool TryLockOSD(void) { return osdLock.tryLock(50); }
+ void LockOSD(void) { osdLock.lock(); }
+ void UnlockOSD(void) { osdLock.unlock(); }
protected:
// Initialization
diff --git a/mythtv/libs/libmythtv/teletextdecoder.cpp b/mythtv/libs/libmythtv/teletextdecoder.cpp
index 4095298..f9db7fc 100644
--- a/mythtv/libs/libmythtv/teletextdecoder.cpp
+++ b/mythtv/libs/libmythtv/teletextdecoder.cpp
@@ -53,7 +53,19 @@ void TeletextDecoder::Decode(const unsigned char *buf, int vbimode)
if (!m_player)
return;
- m_player->LockOSD();
+ int mode = m_player->GetCaptionMode();
+ if (!((mode == kDisplayNUVTeletextCaptions) ||
+ (mode == kDisplayTeletextCaptions) ||
+ (mode == kDisplayTeletextMenu)))
+ {
+ return;
+ }
+
+ if (!m_player->TryLockOSD())
+ {
+ VERBOSE(VB_PLAYBACK, "TeletextDecoder: Failed to get OSD lock.");
+ return;
+ }
if (!m_teletextviewer && m_player)
{
diff --git a/mythtv/libs/libmythtv/teletextscreen.cpp b/mythtv/libs/libmythtv/teletextscreen.cpp
index ea0b72b..599a672 100644
--- a/mythtv/libs/libmythtv/teletextscreen.cpp
+++ b/mythtv/libs/libmythtv/teletextscreen.cpp
@@ -469,6 +469,9 @@ void TeletextScreen::AddPageHeader(int page, int subpage,
const uint8_t * buf,
int vbimode, int lang, int flags)
{
+ if (!m_displaying)
+ return;
+
QMutexLocker locker(&m_lock);
int magazine = MAGAZINE(page);
@@ -547,6 +550,9 @@ void TeletextScreen::AddPageHeader(int page, int subpage,
void TeletextScreen::AddTeletextData(int magazine, int row,
const uint8_t * buf, int vbimode)
{
+ if (!m_displaying)
+ return;
+
QMutexLocker locker(&m_lock);
int b1, b2, b3, err = 0;