summaryrefslogtreecommitdiff
path: root/src/lib/subrip.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-10-03 19:40:11 +0100
committerCarl Hetherington <cth@carlh.net>2014-10-03 19:40:11 +0100
commit6b4fdbdabeb7b6010b5d558fb231e5d4e69487fc (patch)
tree8386e0e13f1d2b81c1a2a528365781e6c8e32e2a /src/lib/subrip.cc
parentc6c082c4a8016f85ba4207f4b8ccee1d5770e4a4 (diff)
Add another .srt test; remove checking of .srt subtitle indices as the strict sequence (1, 2, 3...) does not appear to be strictly adhered to.
Diffstat (limited to 'src/lib/subrip.cc')
-rw-r--r--src/lib/subrip.cc23
1 files changed, 5 insertions, 18 deletions
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<const SubRipContent> content)
} state = COUNTER;
char buffer[256];
- int next_count = 1;
boost::optional<SubRipSubtitle> current;
list<string> 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<const SubRipContent> content)
/* a blank line at the start is ok */
break;
}
-
- int x = 0;
- try {
- x = lexical_cast<int> (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: