Skip to content

Commit

Permalink
mythccextractor: Fix teletext subtitle duration
Browse files Browse the repository at this point in the history
Previously ProcessTeletext() didn't leave one subtitle behind.  This caused the
length calculation in IngestSubtitle() to never be performed, which meant that
the length was always set to the default value 750 ms.

Fixes #11081.
  • Loading branch information
natanojl committed Jan 3, 2013
1 parent d992ac7 commit 018691f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mythtv/libs/libmythtv/mythccextractorplayer.cpp
Expand Up @@ -84,7 +84,7 @@ void MythCCExtractorPlayer::OnGotNewFrame(void)

Ingest608Captions(); Process608Captions(kProcessNormal);
Ingest708Captions(); Process708Captions(kProcessNormal);
IngestTeletext(); ProcessTeletext();
IngestTeletext(); ProcessTeletext(kProcessNormal);
IngestDVBSubtitles(); ProcessDVBSubtitles(kProcessNormal);
}

Expand Down Expand Up @@ -190,6 +190,7 @@ bool MythCCExtractorPlayer::run(void)

Process608Captions(kProcessFinalize);
Process708Captions(kProcessFinalize);
ProcessTeletext(kProcessFinalize);
ProcessDVBSubtitles(kProcessFinalize);

SetPlaying(false);
Expand Down Expand Up @@ -563,7 +564,7 @@ void MythCCExtractorPlayer::IngestTeletext(void)
}
}

void MythCCExtractorPlayer::ProcessTeletext(void)
void MythCCExtractorPlayer::ProcessTeletext(uint flags)
{
int i = 0;
TeletextInfo::iterator ttxit = m_ttx_info.begin();
Expand All @@ -578,6 +579,8 @@ void MythCCExtractorPlayer::ProcessTeletext(void)
{
if ((*it).empty())
continue; // Skip empty subtitle streams.
if (((kProcessFinalize & flags) == 0) && ((*it).size() <= 1))
continue; // Leave one caption behind so it can be amended

uint page = it.key();

Expand Down Expand Up @@ -607,7 +610,7 @@ void MythCCExtractorPlayer::ProcessTeletext(void)
continue;
}

while (!(*it).empty())
while ((*it).size() > ((kProcessFinalize & flags) ? 0 : 1))
{
if ((*it).front().length <= 0)
(*it).front().length = OneSubtitle::kDefaultLength;
Expand Down

0 comments on commit 018691f

Please sign in to comment.