Skip to content

Commit

Permalink
Fix displaying external text subtitles under a rare situation.
Browse files Browse the repository at this point in the history
If external subs are enabled by default and the first video frame has a
zero timestamp, TextSubtitles gets confused about the start and end time
of the last displayed sub.
  • Loading branch information
Mark Kendall committed Dec 15, 2010
1 parent 87db118 commit e139b29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions mythtv/libs/libmythtv/subtitlescreen.cpp
Expand Up @@ -361,6 +361,12 @@ void SubtitleScreen::DisplayTextSubtitles(void)

DeleteAllChildren();
SetRedraw();
if (playPos == 0)
{
subs->Unlock();
return;
}

QStringList rawsubs = subs->GetSubtitles(playPos);
if (rawsubs.empty())
{
Expand Down
6 changes: 5 additions & 1 deletion mythtv/libs/libmythtv/textsubtitleparser.h
Expand Up @@ -40,7 +40,11 @@ typedef vector<text_subtitle_t> TextSubtitleList;
class TextSubtitles
{
public:
TextSubtitles() : m_frameBasedTiming(false) {}
TextSubtitles() : m_frameBasedTiming(false)
{
m_lastReturnedSubtitle.start = 0;
m_lastReturnedSubtitle.end = 0;
}

virtual ~TextSubtitles() {}

Expand Down

0 comments on commit e139b29

Please sign in to comment.