3.0.5582.0

This commit is contained in:
Luke Pulverenti 2015-04-13 23:45:17 -04:00
parent 1fdaee1bb9
commit 5fe9b054c8
7 changed files with 34 additions and 15 deletions

View File

@ -736,7 +736,7 @@ namespace MediaBrowser.Api.Playback.Hls
).Trim(); ).Trim();
} }
return string.Format("{0} {1} -map_metadata -1 -threads {2} {3} {4} -flags -global_header -sc_threshold 0 {5} -hls_time {6} -start_number {7} -hls_list_size {8} -y \"{9}\"", return string.Format("{0} {1} -map_metadata -1 -threads {2} {3} {4} -flags -global_header -copyts -sc_threshold 0 {5} -hls_time {6} -start_number {7} -hls_list_size {8} -y \"{9}\"",
inputModifier, inputModifier,
GetInputArgument(state), GetInputArgument(state),
threads, threads,

View File

@ -1,4 +1,5 @@
using MediaBrowser.Common.Extensions; using System.Globalization;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Channels; using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Collections; using MediaBrowser.Controller.Collections;
@ -1892,5 +1893,18 @@ namespace MediaBrowser.Controller.Entities
return video.RefreshMetadata(newOptions, cancellationToken); return video.RefreshMetadata(newOptions, cancellationToken);
} }
public string GetEtag()
{
return string.Join("|", GetEtagValues().ToArray()).GetMD5().ToString("N");
}
protected virtual List<string> GetEtagValues()
{
return new List<string>
{
DateLastSaved.Ticks.ToString(CultureInfo.InvariantCulture)
};
}
} }
} }

View File

@ -280,7 +280,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
private async Task<List<int>> GetKeyFrames(string inputPath, int videoStreamIndex, CancellationToken cancellationToken) private async Task<List<int>> GetKeyFrames(string inputPath, int videoStreamIndex, CancellationToken cancellationToken)
{ {
const string args = "-i {0} -select_streams v:{1} -show_frames -print_format compact"; const string args = "-i {0} -select_streams v:{1} -show_frames -show_entries frame=pkt_dts,key_frame -print_format compact";
var process = new Process var process = new Process
{ {
@ -310,15 +310,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
StartProcess(processWrapper); StartProcess(processWrapper);
var lines = new List<int>(); var lines = new List<int>();
var outputCancellationSource = new CancellationTokenSource(4000);
try try
{ {
process.BeginErrorReadLine(); process.BeginErrorReadLine();
var linkedCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(outputCancellationSource.Token, cancellationToken); await StartReadingOutput(process.StandardOutput.BaseStream, lines, 120000, cancellationToken).ConfigureAwait(false);
await StartReadingOutput(process.StandardOutput.BaseStream, lines, 120000, outputCancellationSource, linkedCancellationTokenSource.Token).ConfigureAwait(false);
} }
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
@ -335,7 +332,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
return lines; return lines;
} }
private async Task StartReadingOutput(Stream source, List<int> lines, int timeoutMs, CancellationTokenSource cancellationTokenSource, CancellationToken cancellationToken) private async Task StartReadingOutput(Stream source, List<int> lines, int timeoutMs, CancellationToken cancellationToken)
{ {
try try
{ {
@ -362,11 +359,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
{ {
lines.Add(frameMs); lines.Add(frameMs);
} }
if (frameMs > timeoutMs)
{
cancellationTokenSource.Cancel();
}
} }
} }
} }

View File

@ -37,6 +37,12 @@ namespace MediaBrowser.Model.Dto
/// <value>The id.</value> /// <value>The id.</value>
public string Id { get; set; } public string Id { get; set; }
/// <summary>
/// Gets or sets the etag.
/// </summary>
/// <value>The etag.</value>
public string Etag { get; set; }
/// <summary> /// <summary>
/// Gets or sets the playlist item identifier. /// Gets or sets the playlist item identifier.
/// </summary> /// </summary>

View File

@ -75,6 +75,11 @@
/// </summary> /// </summary>
DisplayMediaType, DisplayMediaType,
/// <summary>
/// The etag
/// </summary>
Etag,
/// <summary> /// <summary>
/// The external urls /// The external urls
/// </summary> /// </summary>

View File

@ -357,6 +357,8 @@ namespace MediaBrowser.Server.Implementations.Dto
: item.CanDownload(user); : item.CanDownload(user);
} }
return dto; return dto;
} }

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.0.*")] //[assembly: AssemblyVersion("3.0.*")]
//[assembly: AssemblyVersion("3.0.5572.0")] [assembly: AssemblyVersion("3.0.5582.0")]