Fix reading MicroDVD files

This commit is contained in:
Thomas Goyne 2013-10-06 07:37:35 -07:00
parent 822c596206
commit 62114d45f5
2 changed files with 6 additions and 5 deletions

View file

@ -140,9 +140,10 @@ agi::vfr::Framerate SubtitleFormat::AskForFPS(bool allow_vfr, bool show_smpte) {
choices.Add(_("119.880 FPS (NTSC x4)"));
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);
wxBeginBusyCursor();
if (was_busy) wxBeginBusyCursor();
using agi::vfr::Framerate;
if (choice == -1)

View file

@ -94,7 +94,7 @@ void MicroDVDSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& file
std::string line = file.ReadLineFromFile();
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 (isFirst) {
@ -111,8 +111,8 @@ 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]);
int f1 = boost::lexical_cast<int>(match[1]);
int f2 = boost::lexical_cast<int>(match[2]);
boost::replace_all(text, "|", "\\N");