X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fsubrip.cc;fp=src%2Flib%2Fsubrip.cc;h=6c9cef91655c9fe83efce7724c781196ab6aff13;hb=6b4fdbdabeb7b6010b5d558fb231e5d4e69487fc;hp=11ad3302d3659abf107eed8b8fa69d33d8109c69;hpb=c6c082c4a8016f85ba4207f4b8ccee1d5770e4a4;p=dcpomatic.git diff --git a/src/lib/subrip.cc b/src/lib/subrip.cc index 11ad3302d..6c9cef916 100644 --- a/src/lib/subrip.cc +++ b/src/lib/subrip.cc @@ -49,20 +49,19 @@ SubRip::SubRip (shared_ptr content) } state = COUNTER; char buffer[256]; - int next_count = 1; boost::optional current; list lines; - + while (!feof (f)) { fgets (buffer, sizeof (buffer), f); if (feof (f)) { break; } - + string line (buffer); trim_right_if (line, boost::is_any_of ("\n\r")); - + switch (state) { case COUNTER: { @@ -70,21 +69,9 @@ SubRip::SubRip (shared_ptr content) /* a blank line at the start is ok */ break; } - - int x = 0; - try { - x = lexical_cast (line); - } catch (...) { - } - - if (x == next_count) { - state = METADATA; - ++next_count; - current = SubRipSubtitle (); - } else { - throw SubRipError (line, _("a subtitle count"), content->path (0)); - } + state = METADATA; + current = SubRipSubtitle (); } break; case METADATA: