fixes #2365 - External bitmap subtitles are loaded incorrectly

This commit is contained in:
Luke Pulverenti 2016-12-26 16:22:45 -05:00
parent a5ffea5752
commit cb8751f985
2 changed files with 26 additions and 2 deletions

View File

@ -1068,7 +1068,19 @@ namespace MediaBrowser.Api.Playback
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 + "\"";
}
}

View File

@ -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 + "\"";
}
}