Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 03d161ddaee9f4944bf995b18a6afa141eccf2e1 1 parent bdae22c
Mark Kendall authored
View
5 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
View
14 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)
{
View
6 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;
Please sign in to comment.
Something went wrong with that request. Please try again.