fixes #619 - Command line fail for internal subs

This commit is contained in:
Luke Pulverenti
2013-11-20 10:50:54 -05:00
parent f727179222
commit 7dd75e079a
4 changed files with 31 additions and 25 deletions

View File

@@ -143,12 +143,19 @@ namespace MediaBrowser.Api.Playback.Progressive
args += keyFrameArg;
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsExternal &&
(state.SubtitleStream.Codec.IndexOf("pgs", StringComparison.OrdinalIgnoreCase) != -1 ||
state.SubtitleStream.Codec.IndexOf("dvd", StringComparison.OrdinalIgnoreCase) != -1);
var request = state.VideoRequest;
// Add resolution params, if specified
if (request.Width.HasValue || request.Height.HasValue || request.MaxHeight.HasValue || request.MaxWidth.HasValue)
if (!hasGraphicalSubs)
{
args += GetOutputSizeParam(state, codec, performSubtitleConversion);
if (request.Width.HasValue || request.Height.HasValue || request.MaxHeight.HasValue || request.MaxWidth.HasValue)
{
args += GetOutputSizeParam(state, codec, performSubtitleConversion);
}
}
if (request.Framerate.HasValue)
@@ -175,13 +182,10 @@ namespace MediaBrowser.Api.Playback.Progressive
args += " -level " + state.VideoRequest.Level;
}
if (state.SubtitleStream != null)
// This is for internal graphical subs
if (hasGraphicalSubs)
{
// This is for internal graphical subs
if (!state.SubtitleStream.IsExternal && (state.SubtitleStream.Codec.IndexOf("pgs", StringComparison.OrdinalIgnoreCase) != -1 || state.SubtitleStream.Codec.IndexOf("dvd", StringComparison.OrdinalIgnoreCase) != -1))
{
args += GetInternalGraphicalSubtitleParam(state, codec);
}
args += GetInternalGraphicalSubtitleParam(state, codec);
}
return args;