mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-21 13:10:45 +02:00
fixed chapter extraction
This commit is contained in:
parent
80ef863dfc
commit
43a806ad02
|
@ -61,9 +61,10 @@ namespace MediaBrowser.Controller.MediaInfo
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputFiles">The input files.</param>
|
/// <param name="inputFiles">The input files.</param>
|
||||||
/// <param name="type">The type.</param>
|
/// <param name="type">The type.</param>
|
||||||
|
/// <param name="isAudio">if set to <c>true</c> [is audio].</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
Task<InternalMediaInfoResult> GetMediaInfo(string[] inputFiles, InputType type, CancellationToken cancellationToken);
|
Task<InternalMediaInfoResult> GetMediaInfo(string[] inputFiles, InputType type, bool isAudio, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the probe size argument.
|
/// Gets the probe size argument.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
|
using MediaBrowser.Controller.Entities.Audio;
|
||||||
using MediaBrowser.Controller.MediaInfo;
|
using MediaBrowser.Controller.MediaInfo;
|
||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
|
@ -117,7 +118,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
inputPath = MediaEncoderHelpers.GetInputArgument(video.Path, video.LocationType == LocationType.Remote, video.VideoType, video.IsoType, isoMount, video.PlayableStreamFileNames, out type);
|
inputPath = MediaEncoderHelpers.GetInputArgument(video.Path, video.LocationType == LocationType.Remote, video.VideoType, video.IsoType, isoMount, video.PlayableStreamFileNames, out type);
|
||||||
}
|
}
|
||||||
|
|
||||||
return await MediaEncoder.GetMediaInfo(inputPath, type, cancellationToken).ConfigureAwait(false);
|
return await MediaEncoder.GetMediaInfo(inputPath, type, item is Audio, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -255,13 +255,15 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
||||||
{
|
{
|
||||||
LogHttpRequest(context, index);
|
LogHttpRequest(context, index);
|
||||||
|
|
||||||
if (context.Request.IsWebSocketRequest)
|
var request = context.Request;
|
||||||
|
|
||||||
|
if (request.IsWebSocketRequest)
|
||||||
{
|
{
|
||||||
ProcessWebSocketRequest(context);
|
ProcessWebSocketRequest(context);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var localPath = context.Request.Url.LocalPath;
|
var localPath = request.Url.LocalPath;
|
||||||
|
|
||||||
if (string.Equals(localPath, "/mediabrowser/", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(localPath, "/mediabrowser/", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -288,8 +290,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = context.Request.Url.ToString();
|
var url = request.Url.ToString();
|
||||||
var endPoint = context.Request.RemoteEndPoint;
|
var endPoint = request.RemoteEndPoint;
|
||||||
|
|
||||||
await ProcessRequestAsync(context).ConfigureAwait(false);
|
await ProcessRequestAsync(context).ConfigureAwait(false);
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
return await GetRecording(recording, service.Name, cancellationToken).ConfigureAwait(false);
|
return await GetRecording(recording, service.Name, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readonly SemaphoreSlim _liveStreamSemaphore = new SemaphoreSlim(1, 1);
|
||||||
|
|
||||||
public async Task<LiveStreamInfo> GetRecordingStream(string id, CancellationToken cancellationToken)
|
public async Task<LiveStreamInfo> GetRecordingStream(string id, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var service = ActiveService;
|
var service = ActiveService;
|
||||||
|
|
||||||
|
@ -223,8 +229,17 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_liveStreamSemaphore.Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<LiveStreamInfo> GetChannelStream(string id, CancellationToken cancellationToken)
|
public async Task<LiveStreamInfo> GetChannelStream(string id, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var service = ActiveService;
|
var service = ActiveService;
|
||||||
|
|
||||||
|
@ -239,6 +254,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_liveStreamSemaphore.Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async Task<LiveTvChannel> GetChannel(ChannelInfo channelInfo, string serviceName, CancellationToken cancellationToken)
|
private async Task<LiveTvChannel> GetChannel(ChannelInfo channelInfo, string serviceName, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
@ -1243,9 +1263,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task CloseLiveStream(string id, CancellationToken cancellationToken)
|
public async Task CloseLiveStream(string id, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
return ActiveService.CloseLiveStream(id, cancellationToken);
|
await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await ActiveService.CloseLiveStream(id, cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_liveStreamSemaphore.Release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public GuideInfo GetGuideInfo()
|
public GuideInfo GetGuideInfo()
|
||||||
|
|
|
@ -102,12 +102,13 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inputFiles">The input files.</param>
|
/// <param name="inputFiles">The input files.</param>
|
||||||
/// <param name="type">The type.</param>
|
/// <param name="type">The type.</param>
|
||||||
|
/// <param name="isAudio">if set to <c>true</c> [is audio].</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
public Task<InternalMediaInfoResult> GetMediaInfo(string[] inputFiles, InputType type,
|
public Task<InternalMediaInfoResult> GetMediaInfo(string[] inputFiles, InputType type, bool isAudio,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
return GetMediaInfoInternal(GetInputArgument(inputFiles, type), type != InputType.File,
|
return GetMediaInfoInternal(GetInputArgument(inputFiles, type), !isAudio,
|
||||||
GetProbeSizeArgument(type), cancellationToken);
|
GetProbeSizeArgument(type), cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue