Skip to content

Commit

Permalink
tidy: Convert subtitle text lines array to a std::vector.
Browse files Browse the repository at this point in the history
This are the lines of text that make up a single displayed subtitle.
Eliminates the hard coded limit on the maximum number of lines of text
in an individual subtitle.
  • Loading branch information
linuxdude42 committed Aug 28, 2020
1 parent 9cf4dd3 commit cdda720
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 152 deletions.
6 changes: 2 additions & 4 deletions mythtv/libs/libmythtv/captions/textsubtitleparser.cpp
Expand Up @@ -390,17 +390,15 @@ void TextSubtitleParser::LoadSubtitles(const QString &fileName,
newsub.m_end *= 10;
}

for (int line = 0; line < sub->lines; ++line)
for (size_t line = 0; line < sub->text.size(); ++line)
{
const char *subLine = sub->text[line];
const char *subLine = sub->text[line].c_str();
QString str;
if (textCodec)
str = dec->toUnicode(subLine, strlen(subLine));
else
str = QString(subLine);
newsub.m_textLines.push_back(str);

free(sub->text[line]);
}
target.AddSubtitle(newsub);
}
Expand Down

0 comments on commit cdda720

Please sign in to comment.