Browse Source

* Subtitle::SSA : event line not only 'Dialogue'

master
Alex 'AdUser' Z 6 years ago
parent
commit
2ee007e08a
  1. 2
      lib/Subtitle/SSA/Event.pm
  2. 2
      lib/Subtitle/SSA/Record.pm

2
lib/Subtitle/SSA/Event.pm

@ -32,7 +32,7 @@ sub new {
_type => 'ass', _type => 'ass',
_fields => \%FIELDS, _fields => \%FIELDS,
_format => \@FIELDS_ASS, _format => \@FIELDS_ASS,
_prefix => 'Dialogue', _prefix => qr/(Dialogue|Comment|Picture|Sound|Movie|Command)/,
}; };
if (my $t = $opts{type}) { if (my $t = $opts{type}) {

2
lib/Subtitle/SSA/Record.pm

@ -64,6 +64,8 @@ sub parse {
my $PREFIX = $self->{_prefix}; my $PREFIX = $self->{_prefix};
return $self->error("not looks like $PREFIX line") return $self->error("not looks like $PREFIX line")
unless $line and $line =~ m{^$PREFIX:}i; unless $line and $line =~ m{^$PREFIX:}i;
$self->{_prefix} = $1
if ref($self->{_prefix}) eq 'Regexp';
return $self->error("passed custom fields order not ARRAY ref") return $self->error("passed custom fields order not ARRAY ref")
unless $format and ref($format) eq 'ARRAY'; unless $format and ref($format) eq 'ARRAY';

Loading…
Cancel
Save