@ -59,9 +59,9 @@ namespace MediaBrowser.Api
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose ( bool dispose )
protected virtual void Dispose ( bool dispose )
{
{
var jobCount = A ctiveTranscodingJobs. Count ;
var jobCount = _a ctiveTranscodingJobs. Count ;
Parallel . ForEach ( A ctiveTranscodingJobs, OnTranscodeKillTimerStopped ) ;
Parallel . ForEach ( _a ctiveTranscodingJobs, OnTranscodeKillTimerStopped ) ;
// Try to allow for some time to kill the ffmpeg processes and delete the partial stream files
// Try to allow for some time to kill the ffmpeg processes and delete the partial stream files
if ( jobCount > 0 )
if ( jobCount > 0 )
@ -73,7 +73,7 @@ namespace MediaBrowser.Api
/// <summary>
/// <summary>
/// The active transcoding jobs
/// The active transcoding jobs
/// </summary>
/// </summary>
private readonly List < TranscodingJob > A ctiveTranscodingJobs = new List < TranscodingJob > ( ) ;
private readonly List < TranscodingJob > _a ctiveTranscodingJobs = new List < TranscodingJob > ( ) ;
/// <summary>
/// <summary>
/// Called when [transcode beginning].
/// Called when [transcode beginning].
@ -83,9 +83,9 @@ namespace MediaBrowser.Api
/// <param name="process">The process.</param>
/// <param name="process">The process.</param>
public void OnTranscodeBeginning ( string path , TranscodingJobType type , Process process )
public void OnTranscodeBeginning ( string path , TranscodingJobType type , Process process )
{
{
lock ( A ctiveTranscodingJobs)
lock ( _a ctiveTranscodingJobs)
{
{
A ctiveTranscodingJobs. Add ( new TranscodingJob
_a ctiveTranscodingJobs. Add ( new TranscodingJob
{
{
Type = type ,
Type = type ,
Path = path ,
Path = path ,
@ -105,11 +105,11 @@ namespace MediaBrowser.Api
/// <param name="type">The type.</param>
/// <param name="type">The type.</param>
public void OnTranscodeFailedToStart ( string path , TranscodingJobType type )
public void OnTranscodeFailedToStart ( string path , TranscodingJobType type )
{
{
lock ( A ctiveTranscodingJobs)
lock ( _a ctiveTranscodingJobs)
{
{
var job = A ctiveTranscodingJobs. First ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
var job = _a ctiveTranscodingJobs. First ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
A ctiveTranscodingJobs. Remove ( job ) ;
_a ctiveTranscodingJobs. Remove ( job ) ;
}
}
}
}
@ -121,9 +121,9 @@ namespace MediaBrowser.Api
/// <returns><c>true</c> if [has active transcoding job] [the specified path]; otherwise, <c>false</c>.</returns>
/// <returns><c>true</c> if [has active transcoding job] [the specified path]; otherwise, <c>false</c>.</returns>
public bool HasActiveTranscodingJob ( string path , TranscodingJobType type )
public bool HasActiveTranscodingJob ( string path , TranscodingJobType type )
{
{
lock ( A ctiveTranscodingJobs)
lock ( _a ctiveTranscodingJobs)
{
{
return A ctiveTranscodingJobs. Any ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
return _a ctiveTranscodingJobs. Any ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
}
}
}
}
@ -134,9 +134,9 @@ namespace MediaBrowser.Api
/// <param name="type">The type.</param>
/// <param name="type">The type.</param>
public void OnTranscodeBeginRequest ( string path , TranscodingJobType type )
public void OnTranscodeBeginRequest ( string path , TranscodingJobType type )
{
{
lock ( A ctiveTranscodingJobs)
lock ( _a ctiveTranscodingJobs)
{
{
var job = A ctiveTranscodingJobs. FirstOrDefault ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
var job = _a ctiveTranscodingJobs. FirstOrDefault ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
if ( job = = null )
if ( job = = null )
{
{
@ -160,9 +160,9 @@ namespace MediaBrowser.Api
/// <param name="type">The type.</param>
/// <param name="type">The type.</param>
public void OnTranscodeEndRequest ( string path , TranscodingJobType type )
public void OnTranscodeEndRequest ( string path , TranscodingJobType type )
{
{
lock ( A ctiveTranscodingJobs)
lock ( _a ctiveTranscodingJobs)
{
{
var job = A ctiveTranscodingJobs. FirstOrDefault ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
var job = _a ctiveTranscodingJobs. FirstOrDefault ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
if ( job = = null )
if ( job = = null )
{
{
@ -194,16 +194,16 @@ namespace MediaBrowser.Api
/// <param name="type">The type.</param>
/// <param name="type">The type.</param>
public void OnTranscodingFinished ( string path , TranscodingJobType type )
public void OnTranscodingFinished ( string path , TranscodingJobType type )
{
{
lock ( A ctiveTranscodingJobs)
lock ( _a ctiveTranscodingJobs)
{
{
var job = A ctiveTranscodingJobs. FirstOrDefault ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
var job = _a ctiveTranscodingJobs. FirstOrDefault ( j = > j . Type = = type & & j . Path . Equals ( path , StringComparison . OrdinalIgnoreCase ) ) ;
if ( job = = null )
if ( job = = null )
{
{
return ;
return ;
}
}
A ctiveTranscodingJobs. Remove ( job ) ;
_a ctiveTranscodingJobs. Remove ( job ) ;
if ( job . KillTimer ! = null )
if ( job . KillTimer ! = null )
{
{
@ -221,9 +221,9 @@ namespace MediaBrowser.Api
{
{
var job = ( TranscodingJob ) state ;
var job = ( TranscodingJob ) state ;
lock ( A ctiveTranscodingJobs)
lock ( _a ctiveTranscodingJobs)
{
{
A ctiveTranscodingJobs. Remove ( job ) ;
_a ctiveTranscodingJobs. Remove ( job ) ;
if ( job . KillTimer ! = null )
if ( job . KillTimer ! = null )
{
{
@ -306,10 +306,6 @@ namespace MediaBrowser.Api
/// <value>The active request count.</value>
/// <value>The active request count.</value>
public int ActiveRequestCount { get ; set ; }
public int ActiveRequestCount { get ; set ; }
/// <summary>
/// <summary>
/// <summary>
/// Enum TranscodingJobType
/// </summary>
/// <summary>
/// Gets or sets the kill timer.
/// Gets or sets the kill timer.
/// </summary>
/// </summary>
/// <value>The kill timer.</value>
/// <value>The kill timer.</value>