Parcourir la source

Variable brackets

Zach Isbach il y a 2 ans
Parent
commit
51afff5328
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      encode.pl

+ 3 - 1
encode.pl

@@ -426,11 +426,13 @@ sub subOptions($) {
 	my %tracks = ();
 	my %tracks = ();
 	foreach my $track (@{ $scan->{'subtitle'} }) {
 	foreach my $track (@{ $scan->{'subtitle'} }) {
 		my ($language, $iso, $text, $type);
 		my ($language, $iso, $text, $type);
+    # Sample: N/A
 		($language, $iso, $text, $type) = $track->{'description'} =~
 		($language, $iso, $text, $type) = $track->{'description'} =~
 		  /^([^\(]+)(?:\s+\([^\)]+\))?\s+\(iso\d+\-\d+\:\s+(\w\w\w)\)\s+\((Text|Bitmap)\)\((CC|VOBSUB|PGS|SSA|TX3G|UTF\-\d+)\)/i;
 		  /^([^\(]+)(?:\s+\([^\)]+\))?\s+\(iso\d+\-\d+\:\s+(\w\w\w)\)\s+\((Text|Bitmap)\)\((CC|VOBSUB|PGS|SSA|TX3G|UTF\-\d+)\)/i;
+    # Sample: English (UTF-8)
 		if (!defined($iso)) {
 		if (!defined($iso)) {
 			($language, $type) = $track->{'description'} =~
 			($language, $type) = $track->{'description'} =~
-			  /(\w.*)\ +\[?(CC|VOBSUB|PGS|SSA|TX3G|UTF\-\d+)\]?/i;
+			  /(\w.*)\ +(?:\[|\()?(CC|VOBSUB|PGS|SSA|TX3G|UTF\-\d+)(?:\[|\()?/i;
 			$iso = 'UND';
 			$iso = 'UND';
 		}
 		}
 		if (!defined($iso) || !defined($type)) {
 		if (!defined($iso) || !defined($type)) {