switch (state) {
case COUNTER:
{
+ if (line.empty ()) {
+ /* 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;
throw SubRipError (line, _("a time/position line"), content->path (0));
}
- current->from = convert_time (p[0]);
- current->to = convert_time (p[2]);
+ current->period = ContentTimePeriod (convert_time (p[0]), convert_time (p[2]));
if (p.size() > 3) {
current->x1 = convert_coordinate (p[3]);
return ContentTime ();
}
- return _subtitles.back().to;
+ return _subtitles.back().period.to;
}