summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2010-12-15 04:05:06 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2010-12-15 04:07:03 (GMT)
commitc9e982a1402e627f325da3384d0713c70e00b273 (patch)
treec4ea35b8ce8f1b543364be8115ddb6854870a9e5
parent57059b3546b971011f33a5bebcd5e76ff2038ab1 (diff)
Fix displaying external text subtitles under a rare situation.
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.
-rw-r--r--mythtv/libs/libmythtv/subtitlescreen.cpp6
-rw-r--r--mythtv/libs/libmythtv/textsubtitleparser.h6
2 files changed, 11 insertions, 1 deletions
diff --git a/mythtv/libs/libmythtv/subtitlescreen.cpp b/mythtv/libs/libmythtv/subtitlescreen.cpp
index c09f965..bbef05b 100644
--- a/mythtv/libs/libmythtv/subtitlescreen.cpp
+++ b/mythtv/libs/libmythtv/subtitlescreen.cpp
@@ -361,6 +361,12 @@ void SubtitleScreen::DisplayTextSubtitles(void)
DeleteAllChildren();
SetRedraw();
+ if (playPos == 0)
+ {
+ subs->Unlock();
+ return;
+ }
+
QStringList rawsubs = subs->GetSubtitles(playPos);
if (rawsubs.empty())
{
diff --git a/mythtv/libs/libmythtv/textsubtitleparser.h b/mythtv/libs/libmythtv/textsubtitleparser.h
index 5589984..8f9a23e 100644
--- a/mythtv/libs/libmythtv/textsubtitleparser.h
+++ b/mythtv/libs/libmythtv/textsubtitleparser.h
@@ -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() {}