3.0.5621.4
This commit is contained in:
parent
948bd0216c
commit
3bb1b8c91c
|
@ -228,7 +228,7 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
lock (_activeTranscodingJobs)
|
||||
{
|
||||
var job = _activeTranscodingJobs.First(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
|
||||
var job = _activeTranscodingJobs.First(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
_activeTranscodingJobs.Remove(job);
|
||||
}
|
||||
|
@ -250,19 +250,11 @@ namespace MediaBrowser.Api
|
|||
return GetTranscodingJob(path, type) != null;
|
||||
}
|
||||
|
||||
public TranscodingJob GetTranscodingJobByPlaySessionId(string playSessionId)
|
||||
{
|
||||
lock (_activeTranscodingJobs)
|
||||
{
|
||||
return _activeTranscodingJobs.FirstOrDefault(j => j.PlaySessionId.Equals(playSessionId, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
|
||||
public TranscodingJob GetTranscodingJob(string path, TranscodingJobType type)
|
||||
{
|
||||
lock (_activeTranscodingJobs)
|
||||
{
|
||||
return _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
|
||||
return _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -275,7 +267,7 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
lock (_activeTranscodingJobs)
|
||||
{
|
||||
var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
|
||||
var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (job == null)
|
||||
{
|
||||
|
@ -344,7 +336,7 @@ namespace MediaBrowser.Api
|
|||
if (job.Type != TranscodingJobType.Progressive)
|
||||
{
|
||||
timerDuration = 1800000;
|
||||
|
||||
|
||||
// We can really reduce the timeout for apps that are using the newer api
|
||||
if (!string.IsNullOrWhiteSpace(job.PlaySessionId))
|
||||
{
|
||||
|
@ -462,7 +454,7 @@ namespace MediaBrowser.Api
|
|||
job.DisposeKillTimer();
|
||||
|
||||
Logger.Debug("KillTranscodingJob - JobId {0} PlaySessionId {1}. Killing transcoding", job.Id, job.PlaySessionId);
|
||||
|
||||
|
||||
lock (_activeTranscodingJobs)
|
||||
{
|
||||
_activeTranscodingJobs.Remove(job);
|
||||
|
|
|
@ -185,7 +185,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
{
|
||||
var startTranscoding = false;
|
||||
|
||||
var currentTranscodingIndex = GetCurrentTranscodingIndex(playlistPath, request.PlaySessionId, segmentExtension);
|
||||
var currentTranscodingIndex = GetCurrentTranscodingIndex(playlistPath, segmentExtension);
|
||||
var segmentGapRequiringTranscodingChange = 24 / state.SegmentLength;
|
||||
|
||||
if (currentTranscodingIndex == null)
|
||||
|
@ -325,11 +325,9 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
return position;
|
||||
}
|
||||
|
||||
public int? GetCurrentTranscodingIndex(string playlist, string playSessionId, string segmentExtension)
|
||||
public int? GetCurrentTranscodingIndex(string playlist, string segmentExtension)
|
||||
{
|
||||
var job = string.IsNullOrWhiteSpace(playSessionId) ?
|
||||
ApiEntryPoint.Instance.GetTranscodingJob(playlist, TranscodingJobType) :
|
||||
ApiEntryPoint.Instance.GetTranscodingJobByPlaySessionId(playSessionId);
|
||||
var job = ApiEntryPoint.Instance.GetTranscodingJob(playlist, TranscodingJobType);
|
||||
|
||||
if (job == null || job.HasExited)
|
||||
{
|
||||
|
@ -844,11 +842,14 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
}
|
||||
|
||||
// See if we can save come cpu cycles by avoiding encoding
|
||||
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
args += state.VideoStream != null && IsH264(state.VideoStream)
|
||||
? args + " -bsf:v h264_mp4toannexb"
|
||||
: args;
|
||||
if (state.VideoStream != null && IsH264(state.VideoStream))
|
||||
{
|
||||
args += " -bsf:v h264_mp4toannexb";
|
||||
}
|
||||
|
||||
args += " -flags -global_header -sc_threshold 0";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -872,9 +873,14 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
{
|
||||
args += GetGraphicalSubtitleParam(state, codec);
|
||||
}
|
||||
|
||||
args += " -flags +loop-global_header -sc_threshold 0";
|
||||
}
|
||||
|
||||
args += " -flags +loop-global_header -sc_threshold 0";
|
||||
if (!EnableSplitTranscoding(state))
|
||||
{
|
||||
args += " -copyts";
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
@ -889,6 +895,8 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
var startNumberParam = isEncoding ? GetStartNumber(state).ToString(UsCulture) : "0";
|
||||
|
||||
var toTimeParam = string.Empty;
|
||||
var timestampOffsetParam = string.Empty;
|
||||
|
||||
if (EnableSplitTranscoding(state))
|
||||
{
|
||||
var startTime = state.Request.StartTimeTicks ?? 0;
|
||||
|
@ -902,14 +910,13 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
//toTimeParam = " -to " + MediaEncoder.GetTimeParameter(endTime);
|
||||
toTimeParam = " -t " + MediaEncoder.GetTimeParameter(TimeSpan.FromSeconds(durationSeconds).Ticks);
|
||||
}
|
||||
|
||||
if (state.IsOutputVideo && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase) && (state.Request.StartTimeTicks ?? 0) > 0)
|
||||
{
|
||||
timestampOffsetParam = " -output_ts_offset " + MediaEncoder.GetTimeParameter(state.Request.StartTimeTicks ?? 0).ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
|
||||
var timestampOffsetParam = string.Empty;
|
||||
if (state.IsOutputVideo)
|
||||
{
|
||||
timestampOffsetParam = " -output_ts_offset " + MediaEncoder.GetTimeParameter(state.Request.StartTimeTicks ?? 0).ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
var mapArgs = state.IsOutputVideo ? GetMapArgs(state) : string.Empty;
|
||||
|
||||
//var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state);
|
||||
|
@ -962,6 +969,11 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
return false;
|
||||
}
|
||||
|
||||
if (string.Equals(state.OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return state.RunTimeTicks.HasValue && state.IsOutputVideo;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.Reflection;
|
||||
|
||||
//[assembly: AssemblyVersion("3.0.*")]
|
||||
[assembly: AssemblyVersion("3.0.5621.3")]
|
||||
[assembly: AssemblyVersion("3.0.5621.4")]
|
||||
|
|
Loading…
Reference in New Issue
Block a user