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()) {
|
while (file.HasMoreLines()) {
|
||||||
boost::smatch match;
|
boost::smatch match;
|
||||||
std::string line = file.ReadLineFromFile();
|
std::string line = file.ReadLineFromFile();
|
||||||
if (regex_match(line, match, line_regex)) {
|
if (!regex_match(line, match, line_regex)) continue;
|
||||||
int f1 = boost::lexical_cast<int>(match[0]);
|
|
||||||
int f2 = boost::lexical_cast<int>(match[1]);
|
|
||||||
std::string text = match[2].str();
|
std::string text = match[2].str();
|
||||||
|
|
||||||
// If it's the first, check if it contains fps information
|
// 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;
|
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");
|
boost::replace_all(text, "|", "\\N");
|
||||||
|
|
||||||
AssDialogue *diag = new AssDialogue;
|
AssDialogue *diag = new AssDialogue;
|
||||||
|
@ -124,7 +126,6 @@ void MicroDVDSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& file
|
||||||
diag->Text = text;
|
diag->Text = text;
|
||||||
target->Line.push_back(*diag);
|
target->Line.push_back(*diag);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroDVDSubtitleFormat::WriteFile(const AssFile *src, agi::fs::path const& filename, std::string const& encoding) const {
|
void MicroDVDSubtitleFormat::WriteFile(const AssFile *src, agi::fs::path const& filename, std::string const& encoding) const {
|
||||||
|
|
Loading…
Reference in a new issue