mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
fix unsupported
This commit is contained in:
parent
78f437401b
commit
dbfa0f3027
1 changed files with 5 additions and 5 deletions
|
@ -36,11 +36,6 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||||
var subtitleFormats = SubtitleFormat.AllSubtitleFormats.Where(asf => asf.Extension.Equals(fileExtension, StringComparison.OrdinalIgnoreCase));
|
var subtitleFormats = SubtitleFormat.AllSubtitleFormats.Where(asf => asf.Extension.Equals(fileExtension, StringComparison.OrdinalIgnoreCase));
|
||||||
foreach (var subtitleFormat in subtitleFormats)
|
foreach (var subtitleFormat in subtitleFormats)
|
||||||
{
|
{
|
||||||
if (subtitleFormat == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Unsupported format: " + fileExtension);
|
|
||||||
}
|
|
||||||
|
|
||||||
subtitleFormat.LoadSubtitle(subtitle, lines, fileExtension);
|
subtitleFormat.LoadSubtitle(subtitle, lines, fileExtension);
|
||||||
if (subtitleFormat.ErrorCount == 0)
|
if (subtitleFormat.ErrorCount == 0)
|
||||||
{
|
{
|
||||||
|
@ -50,6 +45,11 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||||
_logger.LogError("{ErrorCount} errors encountered while parsing subtitle", subtitleFormat.ErrorCount);
|
_logger.LogError("{ErrorCount} errors encountered while parsing subtitle", subtitleFormat.ErrorCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (subtitle.Paragraphs.Count == 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Unsupported format: " + fileExtension);
|
||||||
|
}
|
||||||
|
|
||||||
var trackInfo = new SubtitleTrackInfo();
|
var trackInfo = new SubtitleTrackInfo();
|
||||||
int len = subtitle.Paragraphs.Count;
|
int len = subtitle.Paragraphs.Count;
|
||||||
var trackEvents = new SubtitleTrackEvent[len];
|
var trackEvents = new SubtitleTrackEvent[len];
|
||||||
|
|
Loading…
Reference in a new issue