mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fixes #2365 - External bitmap subtitles are loaded incorrectly
This commit is contained in:
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 += 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 += 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…
x
Reference in New Issue
Block a user