Browse Source

* Subtitle::SSA : fixes

master
Alex 'AdUser' Z 8 years ago
parent
commit
bae3510b59
  1. 10
      lib/Subtitle/SSA.pm

10
lib/Subtitle/SSA.pm

@ -54,7 +54,7 @@ sub parse {
$section = 'styles';
unless ($self->{type}) {
$self->{type} = ($1) ? 'ass' : 'ssa';
$self->log(warn => "Set type to $self->{type} because of $linenum (fallback mode)");
$self->log(warn => "Set type to $self->{type} because of line $linenum (fallback mode)");
}
} else {
undef $section;
@ -83,12 +83,12 @@ sub parse {
push @{ $self->{h_order} }, $key;
}
$self->{headers}->{$key} = $header;
next;
if ($key eq 'scripttype') {
my $type = index($header->{type}, "+") >= 0 ? 'ass' : 'ssa';
$self->log(info => "File recognized as '$type' type from header at $linenum");
my $type = index($header->{value}, "+") >= 0 ? 'ass' : 'ssa';
$self->log(info => "File recognized as '$type' type from header at line $linenum");
$self->{type} = $type;
}
next;
}
if ($section eq 'styles') {
if ($line =~ m/^\s*Format:/oi) {
@ -118,7 +118,7 @@ sub parse {
}
next;
}
$self->log(warn => "unrecognized line at $linenum: $line");
$self->log(warn => "unrecognized line at line $linenum: $line");
}
return scalar @{ $self->{events} };

Loading…
Cancel
Save