|
@@ -474,7 +474,19 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|
|
|
|
|
arg += string.Format(" -canvas_size {0}:{1}", state.VideoStream.Width.Value.ToString(CultureInfo.InvariantCulture), Convert.ToInt32(height).ToString(CultureInfo.InvariantCulture));
|
|
|
}
|
|
|
- arg += " -i \"" + state.SubtitleStream.Path + "\"";
|
|
|
+
|
|
|
+ var subtitlePath = state.SubtitleStream.Path;
|
|
|
+
|
|
|
+ if (string.Equals(Path.GetExtension(subtitlePath), ".sub", StringComparison.OrdinalIgnoreCase))
|
|
|
+ {
|
|
|
+ var idxFile = Path.ChangeExtension(subtitlePath, ".idx");
|
|
|
+ if (FileSystem.FileExists(idxFile))
|
|
|
+ {
|
|
|
+ subtitlePath = idxFile;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ arg += " -i \"" + subtitlePath + "\"";
|
|
|
}
|
|
|
}
|
|
|
|