Shuffle some stuff around in MicroDVDSubtitleFormat::ReadFile
This commit is contained in:
parent
b743bb39b0
commit
d6fd2f016b
1 changed files with 23 additions and 22 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue