summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2010-11-14 07:02:00 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2010-11-14 07:02:00 (GMT)
commit29f7209ed1ffdfa0de85a93e9908ac1afd33ba2a (patch)
tree7ca93b1bc702b9d5a6335f9cef7a69a6756c40aa
parent42f9d25588493f6ca5b43260e482e205e427a547 (diff)
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. Closes #9218 git-svn-id: http://svn.mythtv.org/svn/trunk@27213 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 87fe21b..83371ca 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;