Răsfoiți Sursa

Sort subtitles to preserve input order

Zach Isbach 3 ani în urmă
părinte
comite
f345d616a9
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 3 2
      encode.pl

+ 3 - 2
encode.pl

@@ -323,7 +323,7 @@ foreach my $title (keys(%titles)) {
 		$bad_crop = 1;
 		$bad_crop = 1;
 	}
 	}
 
 
-	# Disable cropping (if no crop argument is passed, HB will autocrop, so set 0:0:0:0 explictly)
+	# Disable cropping (if no crop argument is passed HB will autocrop, so set 0:0:0:0 explictly)
 	if ($NO_CROP || $bad_crop) {
 	if ($NO_CROP || $bad_crop) {
 		my @crop = (0, 0, 0, 0);
 		my @crop = (0, 0, 0, 0);
 		$scan->{'crop'} = \@crop;
 		$scan->{'crop'} = \@crop;
@@ -379,7 +379,8 @@ foreach my $title (keys(%titles)) {
 
 
 	# Include subtitles if available
 	# Include subtitles if available
 	if (scalar(@subs)) {
 	if (scalar(@subs)) {
-		push(@args, @subs);
+		# Sorted, to keep the original order
+		push(@args, sort(@subs));
 	}
 	}
 
 
 	# Include audio unless specifically excluded
 	# Include audio unless specifically excluded