Shuffle some stuff around in MicroDVDSubtitleFormat::ReadFile

This commit is contained in:
Thomas Goyne 2013-04-16 19:30:29 -07:00
parent b743bb39b0
commit d6fd2f016b

View file

@ -96,9 +96,8 @@ void MicroDVDSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& file
while (file.HasMoreLines()) {
boost::smatch match;
std::string line = file.ReadLineFromFile();
if (regex_match(line, match, line_regex)) {
int f1 = boost::lexical_cast<int>(match[0]);
int f2 = boost::lexical_cast<int>(match[1]);
if (!regex_match(line, match, line_regex)) continue;
std::string text = match[2].str();
// If it's the first, check if it contains fps information
@ -116,6 +115,9 @@ void MicroDVDSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& file
if (!fps.IsLoaded()) return;
}
int f1 = boost::lexical_cast<int>(match[0]);
int f2 = boost::lexical_cast<int>(match[1]);
boost::replace_all(text, "|", "\\N");
AssDialogue *diag = new AssDialogue;
@ -125,7 +127,6 @@ void MicroDVDSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& file
target->Line.push_back(*diag);
}
}
}
void MicroDVDSubtitleFormat::WriteFile(const AssFile *src, agi::fs::path const& filename, std::string const& encoding) const {
agi::vfr::Framerate fps = AskForFPS(true, false);