forked from mia/Aegisub
Fix reading MicroDVD files
This commit is contained in:
parent
822c596206
commit
62114d45f5
2 changed files with 6 additions and 5 deletions
|
@ -140,9 +140,10 @@ agi::vfr::Framerate SubtitleFormat::AskForFPS(bool allow_vfr, bool show_smpte) {
|
||||||
choices.Add(_("119.880 FPS (NTSC x4)"));
|
choices.Add(_("119.880 FPS (NTSC x4)"));
|
||||||
choices.Add(_("120.000 FPS"));
|
choices.Add(_("120.000 FPS"));
|
||||||
|
|
||||||
wxEndBusyCursor();
|
bool was_busy = wxIsBusy();
|
||||||
|
if (was_busy) wxEndBusyCursor();
|
||||||
int choice = wxGetSingleChoiceIndex(_("Please choose the appropriate FPS for the subtitles:"), _("FPS"), choices);
|
int choice = wxGetSingleChoiceIndex(_("Please choose the appropriate FPS for the subtitles:"), _("FPS"), choices);
|
||||||
wxBeginBusyCursor();
|
if (was_busy) wxBeginBusyCursor();
|
||||||
|
|
||||||
using agi::vfr::Framerate;
|
using agi::vfr::Framerate;
|
||||||
if (choice == -1)
|
if (choice == -1)
|
||||||
|
|
|
@ -94,7 +94,7 @@ void MicroDVDSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& file
|
||||||
std::string line = file.ReadLineFromFile();
|
std::string line = file.ReadLineFromFile();
|
||||||
if (!regex_match(line, match, line_regex)) continue;
|
if (!regex_match(line, match, line_regex)) continue;
|
||||||
|
|
||||||
std::string text = match[2].str();
|
std::string text = match[3].str();
|
||||||
|
|
||||||
// If it's the first, check if it contains fps information
|
// If it's the first, check if it contains fps information
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
|
@ -111,8 +111,8 @@ 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 f1 = boost::lexical_cast<int>(match[1]);
|
||||||
int f2 = boost::lexical_cast<int>(match[1]);
|
int f2 = boost::lexical_cast<int>(match[2]);
|
||||||
|
|
||||||
boost::replace_all(text, "|", "\\N");
|
boost::replace_all(text, "|", "\\N");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue