fixes #2365 - External bitmap subtitles are loaded incorrectly

pull/1154/head
Luke Pulverenti 8 years ago
parent a5ffea5752
commit cb8751f985

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

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

Loading…
Cancel
Save