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:05:06 (GMT)
commite139b299395a545ba289f6c6ad46b9d27d7d5c60 (patch)
tree7b9a098378a187b7343041cc506efa93d6c30d2c
parent87db1180340ab86b24cf7b2a09ffe5acdae4a918 (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() {}