mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 23:13:06 +03:00
Revert back to 10e57ce8d21b4516733894075001819f3cd6db6b for MediaEncoding
Remove some duplicate code that were causing warnings
This commit is contained in:
@@ -15,7 +15,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
public bool IsCancelled { get; internal set; }
|
||||
|
||||
public Stream LogFileStream { get; set; }
|
||||
public IProgress<double> Progress { get; set; }
|
||||
public TaskCompletionSource<bool> TaskCompletionSource;
|
||||
|
||||
public EncodingJobOptions Options
|
||||
@@ -24,34 +23,22 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
set => BaseRequest = value;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string MimeType { get; set; }
|
||||
public bool EstimateContentLength { get; set; }
|
||||
public TranscodeSeekInfo TranscodeSeekInfo { get; set; }
|
||||
public long? EncodingDurationTicks { get; set; }
|
||||
|
||||
public string ItemType { get; set; }
|
||||
|
||||
public string GetMimeType(string outputPath)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(MimeType))
|
||||
{
|
||||
return MimeType;
|
||||
}
|
||||
|
||||
return MimeTypes.GetMimeType(outputPath);
|
||||
}
|
||||
|
||||
private readonly ILogger _logger;
|
||||
private readonly IMediaSourceManager _mediaSourceManager;
|
||||
|
||||
public EncodingJob(ILogger logger, IMediaSourceManager mediaSourceManager) :
|
||||
base(logger, mediaSourceManager, TranscodingJobType.Progressive)
|
||||
base(TranscodingJobType.Progressive)
|
||||
{
|
||||
_logger = logger;
|
||||
_mediaSourceManager = mediaSourceManager;
|
||||
Id = Guid.NewGuid().ToString("N");
|
||||
Id = Guid.NewGuid();
|
||||
|
||||
_logger = logger;
|
||||
TaskCompletionSource = new TaskCompletionSource<bool>();
|
||||
@@ -61,6 +48,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
DisposeLiveStream();
|
||||
DisposeLogStream();
|
||||
DisposeIsoMount();
|
||||
}
|
||||
|
||||
private void DisposeLogStream()
|
||||
@@ -95,49 +83,21 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
}
|
||||
|
||||
public string OutputFilePath { get; set; }
|
||||
|
||||
public string ActualOutputVideoCodec
|
||||
private void DisposeIsoMount()
|
||||
{
|
||||
get
|
||||
if (IsoMount != null)
|
||||
{
|
||||
var codec = OutputVideoCodec;
|
||||
|
||||
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||
try
|
||||
{
|
||||
var stream = VideoStream;
|
||||
|
||||
if (stream != null)
|
||||
{
|
||||
return stream.Codec;
|
||||
}
|
||||
|
||||
return null;
|
||||
IsoMount.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError("Error disposing iso mount", ex);
|
||||
}
|
||||
|
||||
return codec;
|
||||
}
|
||||
}
|
||||
|
||||
public string ActualOutputAudioCodec
|
||||
{
|
||||
get
|
||||
{
|
||||
var codec = OutputAudioCodec;
|
||||
|
||||
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var stream = AudioStream;
|
||||
|
||||
if (stream != null)
|
||||
{
|
||||
return stream.Codec;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return codec;
|
||||
IsoMount = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user